mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 18:09:27 +02:00
* Fix bug ID #37555, better openssl version call handling
git-svn-id: trunk@46759 -
This commit is contained in:
parent
03778f9b7f
commit
d856233ea1
@ -1152,7 +1152,7 @@ var
|
||||
function EvpPkeyAssign(pkey: PEVP_PKEY; _type: cInt; key: Prsa): cInt;
|
||||
function EvpGetDigestByName(Name: String): PEVP_MD;
|
||||
procedure EVPcleanup;
|
||||
function SSLeayversion(t: cInt): string; deprecated 'For 1.1+ use OpenSSL_version';
|
||||
function SSLeayversion(t: cInt): string; deprecated 'For 1.1+ use OpenSSLGetVersion';
|
||||
procedure ErrErrorString(e: cInt; var buf: string; len: cInt);
|
||||
function ErrGetError: cInt;
|
||||
procedure ErrClearError;
|
||||
@ -1243,7 +1243,7 @@ var
|
||||
|
||||
// Crypto Functions
|
||||
|
||||
function SSLeay_version(t: cint): PChar;
|
||||
function SSLeay_version(t: cint): PChar; deprecated 'For 1.1+ use OpenSSLGetVersion';
|
||||
|
||||
// EVP Functions - evp.h
|
||||
function EVP_des_ede3_cbc : PEVP_CIPHER;
|
||||
@ -1551,7 +1551,6 @@ end;
|
||||
|
||||
type
|
||||
// libssl.dll
|
||||
TOpenSSLversion = function (arg : cint) : pchar; cdecl;
|
||||
TSslGetError = function(s: PSSL; ret_code: cInt):cInt; cdecl;
|
||||
TSslLibraryInit = function:cInt; cdecl;
|
||||
TOPENSSL_INIT_new = function : POPENSSL_INIT_SETTINGS; cdecl;
|
||||
@ -1631,6 +1630,7 @@ type
|
||||
TEvpPkeyAssign = function(pkey: PEVP_PKEY; _type: cInt; key: Prsa): cInt; cdecl;
|
||||
TEvpGetDigestByName = function(Name: PChar): PEVP_MD; cdecl;
|
||||
TEVPcleanup = procedure; cdecl;
|
||||
TOpenSSLversion = function (arg : cint) : pchar; cdecl;
|
||||
TSSLeayversion = function(t: cInt): PChar; cdecl;
|
||||
TErrErrorString = procedure(e: cInt; buf: PChar; len: cInt); cdecl;
|
||||
TErrGetError = function: cInt; cdecl;
|
||||
@ -1716,7 +1716,6 @@ type
|
||||
|
||||
// Crypto Functions
|
||||
|
||||
TSSLeay_version = function(t: cint): PChar; cdecl;
|
||||
TCRYPTOcleanupAllExData = procedure; cdecl;
|
||||
TOPENSSLaddallalgorithms = procedure; cdecl;
|
||||
|
||||
@ -1789,7 +1788,6 @@ type
|
||||
|
||||
var
|
||||
// libssl.dll
|
||||
_OpenSSLVersion : TOpenSSLversion = Nil;
|
||||
_SslGetError: TSslGetError = nil;
|
||||
_SslLibraryInit: TSslLibraryInit = nil;
|
||||
_OPENSSL_init_ssl : TOPENSSL_init_ssl = Nil;
|
||||
@ -1868,6 +1866,7 @@ var
|
||||
_EvpPkeyAssign: TEvpPkeyAssign = nil;
|
||||
_EvpGetDigestByName: TEvpGetDigestByName = nil;
|
||||
_EVPcleanup: TEVPcleanup = nil;
|
||||
_OpenSSLVersion : TOpenSSLversion = Nil;
|
||||
_SSLeayversion: TSSLeayversion = nil;
|
||||
_ErrErrorString: TErrErrorString = nil;
|
||||
_ErrGetError: TErrGetError = nil;
|
||||
@ -1971,7 +1970,6 @@ var
|
||||
|
||||
// Crypto Functions
|
||||
|
||||
_SSLeay_version: TSSLeay_version = nil;
|
||||
_CRYPTOcleanupAllExData: TCRYPTOcleanupAllExData = nil;
|
||||
_OPENSSLaddallalgorithms: TOPENSSLaddallalgorithms = nil;
|
||||
|
||||
@ -3350,8 +3348,8 @@ end;
|
||||
|
||||
function SSLeay_version(t: cint): PChar;
|
||||
begin
|
||||
if InitSSLInterface and Assigned(_SSLeay_version) then
|
||||
Result := _SSLeay_version(t)
|
||||
if InitSSLInterface and Assigned(_SSLeayversion) then
|
||||
Result := _SSLeayversion(t)
|
||||
else
|
||||
Result := nil;
|
||||
end;
|
||||
@ -4858,7 +4856,6 @@ end;
|
||||
Procedure LoadSSLEntryPoints;
|
||||
|
||||
begin
|
||||
_OpenSSLVersion := GetProcAddr(SSLLibHandle, 'OpenSSL_version');
|
||||
_SslGetError := GetProcAddr(SSLLibHandle, 'SSL_get_error');
|
||||
_SslLibraryInit := GetProcAddr(SSLLibHandle, 'SSL_library_init');
|
||||
_OPENSSL_init_ssl := GetProcAddr(SSLLibHandle, 'OPENSSL_init_ssl');
|
||||
@ -4950,9 +4947,10 @@ begin
|
||||
_EvpPkeyAssign := GetProcAddr(SSLUtilHandle, 'EVP_PKEY_assign');
|
||||
_EVPCleanup := GetProcAddr(SSLUtilHandle, 'EVP_cleanup');
|
||||
_EvpGetDigestByName := GetProcAddr(SSLUtilHandle, 'EVP_get_digestbyname');
|
||||
_OpenSSLVersion := GetProcAddr(SSLUtilHandle, 'OpenSSL_version');
|
||||
_SSLeayversion := GetProcAddr(SSLUtilHandle, 'SSLeay_version');
|
||||
if @_SSLeayversion=Nil then
|
||||
_SSLeayversion := GetProcAddr(SSLUtilHandle, 'OpenSSL_version');
|
||||
_SSLeayversion := _OpenSSLVersion;
|
||||
_ErrErrorString := GetProcAddr(SSLUtilHandle, 'ERR_error_string_n');
|
||||
_ErrGetError := GetProcAddr(SSLUtilHandle, 'ERR_get_error');
|
||||
_ErrClearError := GetProcAddr(SSLUtilHandle, 'ERR_clear_error');
|
||||
@ -5090,8 +5088,6 @@ begin
|
||||
_BIO_s_file := GetProcAddr(SSLUtilHandle, 'BIO_s_file');
|
||||
_BIO_new_file := GetProcAddr(SSLUtilHandle, 'BIO_new_file');
|
||||
_BIO_new_mem_buf := GetProcAddr(SSLUtilHandle, 'BIO_new_mem_buf');
|
||||
// Crypto Functions
|
||||
_SSLeay_version := GetProcAddr(SSLUtilHandle, 'SSLeay_version');
|
||||
// PKCS7
|
||||
_PKCS7_ISSUER_AND_SERIAL_new:=GetProcAddr(SSLUtilHandle,'PKCS7_ISSUER_AND_SERIAL_new');
|
||||
_PKCS7_ISSUER_AND_SERIAL_free:=GetProcAddr(SSLUtilHandle,'PKCS7_ISSUER_AND_SERIAL_free');
|
||||
@ -5217,7 +5213,6 @@ end;
|
||||
Procedure ClearSSLEntryPoints;
|
||||
|
||||
begin
|
||||
_OpenSSLVersion := Nil;
|
||||
_SslGetError := nil;
|
||||
_SslLibraryInit := nil;
|
||||
_OPENSSL_init_ssl:=Nil;
|
||||
@ -5396,6 +5391,7 @@ end;
|
||||
Procedure ClearUtilEntryPoints;
|
||||
|
||||
begin
|
||||
_OpenSSLVersion := Nil;
|
||||
_SSLeayversion := nil;
|
||||
_ERR_load_crypto_strings := nil;
|
||||
_OPENSSL_init_crypto:=Nil;
|
||||
@ -5564,10 +5560,6 @@ begin
|
||||
_BIO_s_file := nil;
|
||||
_BIO_new_file := nil;
|
||||
_BIO_new_mem_buf := nil;
|
||||
|
||||
// Crypto Functions
|
||||
|
||||
_SSLeay_version := nil;
|
||||
end;
|
||||
|
||||
procedure locking_callback(mode, ltype: integer; lfile: PChar; line: integer); cdecl;
|
||||
|
Loading…
Reference in New Issue
Block a user