Skip to Content.
Sympa Menu

freetds - Re: TDS 7.0 login packet is correct ?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT ais.org>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: TDS 7.0 login packet is correct ?
  • Date: Fri, 29 Mar 2002 17:20:33 -0500 (EST)



oops, my bad on the strings, yes you are correct. The other things are
still problematic though.

Brian

On Fri, 29 Mar 2002, Fernando wrote:

> Hello,
>
>
> Tank you very mutch by attetion Brian Bruns. In your analyse you did
> question the following points:
>
> > 00D8 packet size bigger than the netlib header, and apparently in the
> > wrong byte order
> > 0066 pos password, 0x56 + 0x08 != 0x66
> > 0082 pos servername, 0x72 + 0x08 != 82
> > 0094 pos libname, 0x82 + 9 != 0x94
> > 00A8 pos lang, 0x94 + A != A8
> > 00A8 size of (8 + 6 + 8 + 9 + 10 = 41 + 86 (fixed portion) = 127 = 0x7F)
> > so your variable data ends at 0x7F (i think) but your numbers are off all
> > the way through.
>
>
> I see this code in freetds java source:
>
> //....
> short len = (short)(86 + 2 * (user.length() +
> password.length() +
> appName.length() +
> serverName.length() +
> libName.length()));
> //....
> comm.appendTdsShort((short)user.length()); <-- 1x
> curPos += user.length() * 2; <-- 2x
> //....
>
> Then, i puting the double of strings length (mybe Unicode):
>
> 0x56 + 0x08 != 0x66 -- but, 0x56 + 2*(0x08) = 0x66
> 0x72 + 0x08 != 82 -- but, 0x72 + 2*(0x08) = 0x82
> 0x82 + 9 != 0x94 -- but, 0x82 + 2*(0x09) = 0x94
> 0x94 + A != A8 -- but, 0x94 + 2*(0x0A) = 0xA8
> 00A8 size of (8 + 6 + 8 + 9 + 10 = 41 + 86 (fixed portion) = 127 = 0x7F)
> but, 2*((8 + 6 + 8 + 9 + 10) = 82 + 86 (fixed portion) = 168 = 0xA8)
>
> I'm confused. Wich way is correct ?
>
>
> "fernando" = 6600650072006E0061006E0064006F00 or 6665726E616E646F ???
>
>
> Could you see my message(Any question about TDS) ??
>
>
> Regards !!
>
>
> > On Fri, 29 Mar 2002, Fernando wrote:
> >
> > > Hello All,
> > >
> > > Anybody know say me if the TD7.0 login packet following is valid ?
> > >
> > >
> > > UserName = 'fernando'
> > > Pwd = 'abc123'
> > > ServerName = 'Satellite'
> > > AppName = 'TDSTrace'
> > > LibraryName = 'DB-Library'
> > >
> > >
> > /* netlib header */
> > 10 0x10 TDS 7 login packet identifier
> > 01 Last packet indicator ( true )
> > 00A8 packet size (168 octets)
> > 00001000 unknown
> > /* TDS payload */
> > 00D8 packet size bigger than the netlib header, and apparently in the
> > wrong byte order
> > 0000000000
> > five 0x00's, ok
> > 70 version number, ok
> > 00000000000000
> > seven 0x00's, ok
> > 0682F2F8FF00000000E003000088FFFFFF36040000
> > magic, agrees with mine, ok
> > 0056 position of hostname, ok
> > 0000 length of hostname, ok
> > 0056 pos of username, ok
> > 0008 len of username, ok
> > 0066 pos password, 0x56 + 0x08 != 0x66
> > 0006 len password, ok
> > 0072 pos appname, ok
> > 0008 len appname, ok
> > 0082 pos servername, 0x72 + 0x08 != 82
> > 0009 len servername, ok
> > 0000 pos unknown
> > 0000 len unknown
> > 0094 pos libname, 0x82 + 9 != 0x94
> > 000A len libname, ok
> > 00A8 pos lang, 0x94 + A != A8
> > 0000 len lang, ok
> > 00A8 pos dbname, ok
> > 0000 len dbname, ok
> > 0040339A6B50
> > magic2, ok
> > 00A8 size of (8 + 6 + 8 + 9 + 10 = 41 + 86 (fixed portion) = 127 = 0x7F)
> > so your variable data ends at 0x7F (i think) but your numbers are off all
> > the way through.
> >
> > 003000D800006600650072006E0061006E0064006F00610062006300310032003300540044005300540072006100630065006C006F00630061006C0068006F0073007400440042002D004C006900620072006100720079004E544C4D5353500001000000068200000000000000000000000000000000000000000000300000000000000030000000
> > >
> > > Regards!
> > >
>
> ---
> You are currently subscribed to freetds as: [camber AT ais.org]
> To unsubscribe, forward this message to $subst('Email.Unsub')
>





Archive powered by MHonArc 2.6.24.

Top of Page