Skip to content
Permalink
Browse files

#227 adaptation

- thanks Svetozar for the patch!
  • Loading branch information...
Arnaud Bouchez
Arnaud Bouchez committed Jul 29, 2019
1 parent a7e1a5d commit 60866d8de441620e1aa74e653a7c60207ed80967
Showing with 15 additions and 18 deletions.
  1. +1 −0 ReadMe.txt
  2. +13 −17 SynWinSock.pas
  3. +1 −1 SynopseCommit.inc
@@ -70,6 +70,7 @@ Contributors
Sllimr7139
SSoftPro
Stefan (itSDS)
Svetozar Belic (transmogrifix)
Transmogrifix
Uian2000
Vaclav
@@ -31,6 +31,10 @@
All Rights Reserved.
Contributor(s):
- Arnaud Bouchez, Jan 2009, for SynCrtSock: see https://synopse.info
Delphi 2009/2010 compatibility (Jan 2010): the WinSock library
expects Ansi encoded parameters
- Svetozar Belic (transmogrifix)
Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -51,12 +55,6 @@
Low level access to network Sockets
*************************************
Contributor(s):
- Arnaud Bouchez, Jan 2009, for SynCrtSock: see https://synopse.info
Delphi 2009/2010 compatibility (Jan 2010): the WinSock library
expects Ansi encoded parameters
Version 1.18
- fixed ticket [f79ff5714b] about potential finalization issues as .bpl in IDE
- fixed Win64 compatibility issue
@@ -1803,8 +1801,7 @@ function TSChannelClient.Receive(aSocket: THandle; aBuffer: pointer; aLength: in
buf: array[0..3] of TSecBuffer;
res: cardinal;
read, i: integer;
needsRenegotiate: Boolean;

needsRenegotiate: boolean;
function DecryptInput: cardinal;
begin
buf[0].cbBuffer := InputCount;
@@ -1819,7 +1816,7 @@ function TSChannelClient.Receive(aSocket: THandle; aBuffer: pointer; aLength: in
buf[3].cbBuffer := 0;
buf[3].BufferType := SECBUFFER_EMPTY;
buf[3].pvBuffer := nil;
Result := DecryptMessage(@Ctxt, @desc, 0, nil);
result := DecryptMessage(@Ctxt, @desc, 0, nil);
end;
begin
if not Initialized then begin // use plain socket API
@@ -1842,28 +1839,27 @@ function TSChannelClient.Receive(aSocket: THandle; aBuffer: pointer; aLength: in
inc(InputCount, read);
res := DecryptInput;
until res <> SEC_E_INCOMPLETE_MESSAGE;

needsRenegotiate := False;
needsRenegotiate := false;
repeat
case res of
SEC_I_RENEGOTIATE: needsRenegotiate := True;
SEC_I_RENEGOTIATE: needsRenegotiate := true;
SEC_I_CONTEXT_EXPIRED: exit;
SEC_E_INCOMPLETE_MESSAGE: break;
else CheckSEC_E_OK(res);
end;

InputCount := 0;
for i := 1 to 3 do
case buf[i].BufferType of
SECBUFFER_DATA: AppendData(buf[i]);
SECBUFFER_EXTRA:
begin
Move(buf[i].pvBuffer^, PByteArray(Input)[0], buf[i].cbBuffer);
SECBUFFER_EXTRA: begin
Move(buf[i].pvBuffer^, pointer(Input), buf[i].cbBuffer);
InputCount := buf[i].cbBuffer;
end;
end;
if InputCount = 0 then
break;
res := DecryptInput;
until InputCount = 0;
until false;
if needsRenegotiate then
HandshakeLoop(aSocket);
except
@@ -1 +1 @@
'1.18.5294'
'1.18.5296'

0 comments on commit 60866d8

Please sign in to comment.
You can’t perform that action at this time.