📄 ssl_openssl_lib.pas
字号:
if InitSSLInterface and Assigned(_SslMethodV23) then
Result := _SslMethodV23
else
Result := nil;
end;
function SslCtxUsePrivateKey(ctx: PSSL_CTX; pkey: SslPtr):Integer;
begin
if InitSSLInterface and Assigned(_SslCtxUsePrivateKey) then
Result := _SslCtxUsePrivateKey(ctx, pkey)
else
Result := 0;
end;
function SslCtxUsePrivateKeyASN1(pk: integer; ctx: PSSL_CTX; d: String; len: integer):Integer;
begin
if InitSSLInterface and Assigned(_SslCtxUsePrivateKeyASN1) then
Result := _SslCtxUsePrivateKeyASN1(pk, ctx, Sslptr(d), len)
else
Result := 0;
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 SslCtxUseCertificate(ctx: PSSL_CTX; x: SslPtr):Integer;
begin
if InitSSLInterface and Assigned(_SslCtxUseCertificate) then
Result := _SslCtxUseCertificate(ctx, x)
else
Result := 0;
end;
function SslCtxUseCertificateASN1(ctx: PSSL_CTX; len: integer; d: String):Integer;
begin
if InitSSLInterface and Assigned(_SslCtxUseCertificateASN1) then
Result := _SslCtxUseCertificateASN1(ctx, len, SslPtr(d))
else
Result := 0;
end;
function SslCtxUseCertificateFile(ctx: PSSL_CTX; const _file: String; _type: Integer):Integer;
begin
if InitSSLInterface and Assigned(_SslCtxUseCertificateFile) then
Result := _SslCtxUseCertificateFile(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, SslPtr(CAfile), SslPtr(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: SslPtr);
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: SslPtr):PChar;
function SSLCipherGetName(c: SslPtr):String;
begin
if InitSSLInterface and Assigned(_SSLCipherGetName) then
Result := _SSLCipherGetName(c)
else
Result := '';
end;
//function SSLCipherGetBits(c: SslPtr; 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
function X509New: PX509;
begin
if InitSSLInterface and Assigned(_X509New) then
Result := _X509New
else
Result := nil;
end;
procedure X509Free(x: PX509);
begin
if InitSSLInterface and Assigned(_X509Free) then
_X509Free(x);
end;
//function SslX509NameOneline(a: PX509_NAME; buf: PChar; size: Integer):PChar;
function X509NameOneline(a: PX509_NAME; var buf: String; size: Integer):String;
begin
if InitSSLInterface and Assigned(_X509NameOneline) then
Result := _X509NameOneline(a, PChar(buf),size)
else
Result := '';
end;
function X509GetSubjectName(a: PX509):PX509_NAME;
begin
if InitSSLInterface and Assigned(_X509GetSubjectName) then
Result := _X509GetSubjectName(a)
else
Result := nil;
end;
function X509GetIssuerName(a: PX509):PX509_NAME;
begin
if InitSSLInterface and Assigned(_X509GetIssuerName) then
Result := _X509GetIssuerName(a)
else
Result := nil;
end;
function X509NameHash(x: PX509_NAME):Cardinal;
begin
if InitSSLInterface and Assigned(_X509NameHash) then
Result := _X509NameHash(x)
else
Result := 0;
end;
//function SslX509Digest(data: PX509; _type: PEVP_MD; md: PChar; len: PInteger):Integer;
function X509Digest(data: PX509; _type: PEVP_MD; md: String; var len: Integer):Integer;
begin
if InitSSLInterface and Assigned(_X509Digest) then
Result := _X509Digest(data, _type, PChar(md), @len)
else
Result := 0;
end;
function EvpPkeyNew: EVP_PKEY;
begin
if InitSSLInterface and Assigned(_EvpPkeyNew) then
Result := _EvpPkeyNew
else
Result := nil;
end;
procedure EvpPkeyFree(pk: EVP_PKEY);
begin
if InitSSLInterface and Assigned(_EvpPkeyFree) then
_EvpPkeyFree(pk);
end;
function SSLeayversion(t: integer): string;
begin
if InitSSLInterface and Assigned(_SSLeayversion) then
Result := PChar(_SSLeayversion(t))
else
Result := '';
end;
procedure ErrErrorString(e: integer; var buf: string; len: integer);
begin
if InitSSLInterface and Assigned(_ErrErrorString) then
_ErrErrorString(e, Pointer(buf), len);
buf := PChar(Buf);
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 OPENSSLaddallalgorithms;
begin
if InitSSLInterface and Assigned(_OPENSSLaddallalgorithms) then
_OPENSSLaddallalgorithms;
end;
procedure EVPcleanup;
begin
if InitSSLInterface and Assigned(_EVPcleanup) then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -