IdSocksInfo Socks V4 seems buggy

Giganews Newsgroups
Subject: IdSocksInfo Socks V4 seems buggy
Posted by:  Marc Wagner (t…@vapor.com)
Date: Tue, 13 Mar 2007

Hi all,

I use IdSocksInfo (Delphi 7) and get a malformed package when using socksv4
with authentication.
The socksV4-request is made by a record definied in IdSocks.pas:

type TIdSocksRequest =record
Version : Byte;
OpCode:Byte;
Port:Word;
IpAddr:TIdInAddr;
UserName:String[255]
end;

UserName is a Pascal-String that contains the length in the first byte. If I
use a UserName e.g. "marc"
the package contains a byte $04 which is the length of the name but it is
interpreted as CTRL-D.
If a server tries to compare the committed UserName that contains the length
of the string with e.g. Ident, it will fail.

The Spec of NEC:

VN 1 Byte
CD 1 Byte
DSTPORT 2 Byte
DSTIP 4 Byte
USERID variable
NULL 1 Byte

So, my questions: Is it a bug ???

Thanks for answering,

Marc

Replies