mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 17:19:33 +02:00
* Add OpenSSL_Version
git-svn-id: trunk@42113 -
This commit is contained in:
parent
41f36233ea
commit
3c0805d6a2
@ -1510,6 +1510,7 @@ end;
|
||||
|
||||
type
|
||||
// libssl.dll
|
||||
TOpenSSLversion = function (arg : cint) : pchar; cdecl;
|
||||
TSslGetError = function(s: PSSL; ret_code: cInt):cInt; cdecl;
|
||||
TSslLibraryInit = function:cInt; cdecl;
|
||||
TSslLoadErrorStrings = procedure; cdecl;
|
||||
@ -1740,6 +1741,7 @@ type
|
||||
|
||||
var
|
||||
// libssl.dll
|
||||
_OpenSSLVersion : TOpenSSLversion = Nil;
|
||||
_SslGetError: TSslGetError = nil;
|
||||
_SslLibraryInit: TSslLibraryInit = nil;
|
||||
_SslLoadErrorStrings: TSslLoadErrorStrings = nil;
|
||||
@ -2411,6 +2413,14 @@ begin
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
function OpenSSLGetVersion(t: cint):String;
|
||||
begin
|
||||
if InitSSLInterface and Assigned(_OpenSSLVersion) then
|
||||
Result := _OpenSSLVersion(t)
|
||||
else
|
||||
Result := '';
|
||||
end;
|
||||
|
||||
//function SslGetVersion(ssl: PSSL):PChar;
|
||||
function SslGetVersion(ssl: PSSL):String;
|
||||
begin
|
||||
@ -4672,6 +4682,7 @@ end;
|
||||
Procedure LoadSSLEntryPoints;
|
||||
|
||||
begin
|
||||
_OpenSSLVersion := GetProcAddr(SSLLibHandle, 'OpenSSL_version');
|
||||
_SslGetError := GetProcAddr(SSLLibHandle, 'SSL_get_error');
|
||||
_SslLibraryInit := GetProcAddr(SSLLibHandle, 'SSL_library_init');
|
||||
_SslLoadErrorStrings := GetProcAddr(SSLLibHandle, 'SSL_load_error_strings');
|
||||
@ -5013,7 +5024,8 @@ end;
|
||||
Procedure ClearSSLEntryPoints;
|
||||
|
||||
begin
|
||||
_SslGetError := nil;
|
||||
_OpenSSLVersion := Nil;
|
||||
_SslGetError := nil;
|
||||
_SslLibraryInit := nil;
|
||||
_SslLoadErrorStrings := nil;
|
||||
_SslCtxSetCipherList := nil;
|
||||
|
Loading…
Reference in New Issue
Block a user