📄 synassl.pas
字号:
begin
if InitSSLInterface and Assigned(_SslLibraryInit) then
Result := _SslLibraryInit
else
Result := 1;
end;
procedure SslLoadErrorStrings;
begin
if InitSSLInterface and Assigned(_SslLoadErrorStrings) then
_SslLoadErrorStrings;
end;
//function SslCtxSetCipherList(arg0: PSSL_CTX; str: PChar):Integer;
function SslCtxSetCipherList(arg0: PSSL_CTX; var str: String):Integer;
begin
if InitSSLInterface and Assigned(_SslCtxSetCipherList) then
Result := _SslCtxSetCipherList(arg0, PChar(str))
else
Result := 0;
end;
function SslCtxNew(meth: PSSL_METHOD):PSSL_CTX;
begin
if InitSSLInterface and Assigned(_SslCtxNew) then
Result := _SslCtxNew(meth)
else
Result := nil;
end;
procedure SslCtxFree(arg0: PSSL_CTX);
begin
if InitSSLInterface and Assigned(_SslCtxFree) then
_SslCtxFree(arg0);
end;
function SslSetFd(s: PSSL; fd: Integer):Integer;
begin
if InitSSLInterface and Assigned(_SslSetFd) then
Result := _SslSetFd(s, fd)
else
Result := 0;
end;
function SslMethodV2:PSSL_METHOD;
begin
if InitSSLInterface and Assigned(_SslMethodV2) then
Result := _SslMethodV2
else
Result := nil;
end;
function SslMethodV3:PSSL_METHOD;
begin
if InitSSLInterface and Assigned(_SslMethodV3) then
Result := _SslMethodV3
else
Result := nil;
end;
function SslMethodTLSV1:PSSL_METHOD;
begin
if InitSSLInterface and Assigned(_SslMethodTLSV1) then
Result := _SslMethodTLSV1
else
Result := nil;
end;
function SslMethodV23:PSSL_METHOD;
begin
if InitSSLInterface and Assigned(_SslMethodV23) then
Result := _SslMethodV23
else
Result := nil;
end;
//function SslCtxUsePrivateKeyFile(ctx: PSSL_CTX; const _file: PChar; _type: Integer):Integer;
function SslCtxUsePrivateKeyFile(ctx: PSSL_CTX; const _file: String; _type: Integer):Integer;
begin
if InitSSLInterface and Assigned(_SslCtxUsePrivateKeyFile) then
Result := _SslCtxUsePrivateKeyFile(ctx, PChar(_file), _type)
else
Result := 0;
end;
//function SslCtxUseCertificateChainFile(ctx: PSSL_CTX; const _file: PChar):Integer;
function SslCtxUseCertificateChainFile(ctx: PSSL_CTX; const _file: String):Integer;
begin
if InitSSLInterface and Assigned(_SslCtxUseCertificateChainFile) then
Result := _SslCtxUseCertificateChainFile(ctx, PChar(_file))
else
Result := 0;
end;
function SslCtxCheckPrivateKeyFile(ctx: PSSL_CTX):Integer;
begin
if InitSSLInterface and Assigned(_SslCtxCheckPrivateKeyFile) then
Result := _SslCtxCheckPrivateKeyFile(ctx)
else
Result := 0;
end;
procedure SslCtxSetDefaultPasswdCb(ctx: PSSL_CTX; cb: PPasswdCb);
begin
if InitSSLInterface and Assigned(_SslCtxSetDefaultPasswdCb) then
_SslCtxSetDefaultPasswdCb(ctx, cb);
end;
procedure SslCtxSetDefaultPasswdCbUserdata(ctx: PSSL_CTX; u: SslPtr);
begin
if InitSSLInterface and Assigned(_SslCtxSetDefaultPasswdCbUserdata) then
_SslCtxSetDefaultPasswdCbUserdata(ctx, u);
end;
//function SslCtxLoadVerifyLocations(ctx: PSSL_CTX; const CAfile: PChar; const CApath: PChar):Integer;
function SslCtxLoadVerifyLocations(ctx: PSSL_CTX; const CAfile: String; const CApath: String):Integer;
begin
if InitSSLInterface and Assigned(_SslCtxLoadVerifyLocations) then
Result := _SslCtxLoadVerifyLocations(ctx, Pointer(CAfile), Pointer(CApath))
else
Result := 0;
end;
function SslNew(ctx: PSSL_CTX):PSSL;
begin
if InitSSLInterface and Assigned(_SslNew) then
Result := _SslNew(ctx)
else
Result := nil;
end;
procedure SslFree(ssl: PSSL);
begin
if InitSSLInterface and Assigned(_SslFree) then
_SslFree(ssl);
end;
function SslAccept(ssl: PSSL):Integer;
begin
if InitSSLInterface and Assigned(_SslAccept) then
Result := _SslAccept(ssl)
else
Result := -1;
end;
function SslConnect(ssl: PSSL):Integer;
begin
if InitSSLInterface and Assigned(_SslConnect) then
Result := _SslConnect(ssl)
else
Result := -1;
end;
function SslShutdown(ssl: PSSL):Integer;
begin
if InitSSLInterface and Assigned(_SslShutdown) then
Result := _SslShutdown(ssl)
else
Result := -1;
end;
//function SslRead(ssl: PSSL; buf: PChar; num: Integer):Integer;
function SslRead(ssl: PSSL; buf: SslPtr; num: Integer):Integer;
begin
if InitSSLInterface and Assigned(_SslRead) then
Result := _SslRead(ssl, PChar(buf), num)
else
Result := -1;
end;
//function SslPeek(ssl: PSSL; buf: PChar; num: Integer):Integer;
function SslPeek(ssl: PSSL; buf: SslPtr; num: Integer):Integer;
begin
if InitSSLInterface and Assigned(_SslPeek) then
Result := _SslPeek(ssl, PChar(buf), num)
else
Result := -1;
end;
//function SslWrite(ssl: PSSL; const buf: PChar; num: Integer):Integer;
function SslWrite(ssl: PSSL; buf: SslPtr; num: Integer):Integer;
begin
if InitSSLInterface and Assigned(_SslWrite) then
Result := _SslWrite(ssl, PChar(buf), num)
else
Result := -1;
end;
function SslPending(ssl: PSSL):Integer;
begin
if InitSSLInterface and Assigned(_SslPending) then
Result := _SslPending(ssl)
else
Result := 0;
end;
//function SslGetVersion(ssl: PSSL):PChar;
function SslGetVersion(ssl: PSSL):String;
begin
if InitSSLInterface and Assigned(_SslGetVersion) then
Result := _SslGetVersion(ssl)
else
Result := '';
end;
function SslGetPeerCertificate(ssl: PSSL):PX509;
begin
if InitSSLInterface and Assigned(_SslGetPeerCertificate) then
Result := _SslGetPeerCertificate(ssl)
else
Result := nil;
end;
//procedure SslCtxSetVerify(ctx: PSSL_CTX; mode: Integer; arg2: Pointer);
procedure SslCtxSetVerify(ctx: PSSL_CTX; mode: Integer; arg2: PFunction);
begin
if InitSSLInterface and Assigned(_SslCtxSetVerify) then
_SslCtxSetVerify(ctx, mode, @arg2);
end;
function SSLGetCurrentCipher(s: PSSL):SslPtr;
begin
if InitSSLInterface and Assigned(_SSLGetCurrentCipher) then
{$IFDEF CIL}
{$ELSE}
Result := _SSLGetCurrentCipher(s)
{$ENDIF}
else
Result := nil;
end;
//function SSLCipherGetName(c: pointer):PChar;
function SSLCipherGetName(c: SslPtr):String;
begin
if InitSSLInterface and Assigned(_SSLCipherGetName) then
Result := _SSLCipherGetName(c)
else
Result := '';
end;
//function SSLCipherGetBits(c: pointer; alg_bits: PInteger):Integer;
function SSLCipherGetBits(c: SslPtr; var alg_bits: Integer):Integer;
begin
if InitSSLInterface and Assigned(_SSLCipherGetBits) then
Result := _SSLCipherGetBits(c, @alg_bits)
else
Result := 0;
end;
function SSLGetVerifyResult(ssl: PSSL):Integer;
begin
if InitSSLInterface and Assigned(_SSLGetVerifyResult) then
Result := _SSLGetVerifyResult(ssl)
else
Result := X509_V_ERR_APPLICATION_VERIFICATION;
end;
// libeay.dll
procedure SslX509Free(x: PX509);
begin
if InitSSLInterface and Assigned(_SslX509Free) then
_SslX509Free(x);
end;
//function SslX509NameOneline(a: PX509_NAME; buf: PChar; size: Integer):PChar;
function SslX509NameOneline(a: PX509_NAME; var buf: String; size: Integer):String;
begin
if InitSSLInterface and Assigned(_SslX509NameOneline) then
Result := _SslX509NameOneline(a, PChar(buf),size)
else
Result := '';
end;
function SslX509GetSubjectName(a: PX509):PX509_NAME;
begin
if InitSSLInterface and Assigned(_SslX509GetSubjectName) then
Result := _SslX509GetSubjectName(a)
else
Result := nil;
end;
function SslX509GetIssuerName(a: PX509):PX509_NAME;
begin
if InitSSLInterface and Assigned(_SslX509GetIssuerName) then
Result := _SslX509GetIssuerName(a)
else
Result := nil;
end;
function SslX509NameHash(x: PX509_NAME):Cardinal;
begin
if InitSSLInterface and Assigned(_SslX509NameHash) then
Result := _SslX509NameHash(x)
else
Result := 0;
end;
//function SslX509Digest(data: PX509; _type: PEVP_MD; md: PChar; len: PInteger):Integer;
function SslX509Digest(data: PX509; _type: PEVP_MD; md: String; var len: Integer):Integer;
begin
if InitSSLInterface and Assigned(_SslX509Digest) then
Result := _SslX509Digest(data, _type, PChar(md), @len)
else
Result := 0;
end;
function SslEvpMd5:PEVP_MD;
begin
if InitSSLInterface and Assigned(_SslEvpMd5) then
Result := _SslEvpMd5
else
Result := nil;
end;
//function ErrErrorString(e: integer; buf: PChar): PChar;
function ErrErrorString(e: integer; var buf: String): String;
begin
if InitSSLInterface and Assigned(_ErrErrorString) then
Result := PChar(_ErrErrorString(e, PChar(buf)))
else
Result := '';
end;
function ErrGetError: integer;
begin
if InitSSLInterface and Assigned(_ErrGetError) then
Result := _ErrGetError
else
Result := SSL_ERROR_SSL;
end;
procedure ErrClearError;
begin
if InitSSLInterface and Assigned(_ErrClearError) then
_ErrClearError;
end;
procedure ErrFreeStrings;
begin
if InitSSLInterface and Assigned(_ErrFreeStrings) then
_ErrFreeStrings;
end;
procedure ErrRemoveState(pid: integer);
begin
if InitSSLInterface and Assigned(_ErrRemoveState) then
_ErrRemoveState(pid);
end;
procedure EVPcleanup;
begin
if InitSSLInterface and Assigned(_EVPcleanup) then
_EVPcleanup;
end;
procedure CRYPTOcleanupAllExData;
begin
if InitSSLInterface and Assigned(_CRYPTOcleanupAllExData) then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -