r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[MySQL]

Pekr
9-Jan-2006
[383x5]
>> help checksum
USAGE:

    CHECKSUM data /tcp /secure /hash size /method word /key key-value

DESCRIPTION:
     Returns a CRC or other type of checksum.
     CHECKSUM is a native value.

ARGUMENTS:
     data -- Data to checksum (Type: any-string)

REFINEMENTS:
     /tcp -- Returns an Internet TCP 16-bit checksum.
     /secure -- Returns a cryptographically secure checksum.
     /hash -- Returns a hash value
         size -- Size of the hash table (Type: integer)
     /method -- Method to use
         word -- Method: SHA1 MD5 (Type: word)
     /key -- Returns keyed HMAC value
         key-value -- Key to use (Type: any-string)
so basically checksum/secure checksum/secure "mypass" gives exactly 
the same result as in mysql doc page posted above.....
however, the trouble imo comes from sha1(public-seed, hash_stage2) 
... it calls two times sha1_input, without reading out the result 
first ... I am afraid that maybe we will have to reimplement all 
hashing functions in rebol now?
btw - I put following code into handshake:

read-string (pl/long-seed: join sys-copy pl/crypt-seed string)
to end

simply to not affect old functionality ...
well, and that's all I was capable of so far :-)
Dockimbel
9-Jan-2006
[388]
Ok, thanks for all the info. I'm working on it...
Pekr
9-Jan-2006
[389]
cool! ppl will surely appreciate it - rebol without free mySQL scheme 
is kind of show stopper for some of them :-)
Volker
9-Jan-2006
[390]
sha_input: http://www.distlab.dk/mysql-4.1/html/mysys_2sha1_8c-source.html#l00179

Seems the two inputs are like a join. Usefull this way if one hashes 
files withput loading everything in memory.
Pekr
9-Jan-2006
[391]
join?
Volker
9-Jan-2006
[392x2]
Accepts an array of octets as the next portion of the message.
if you do two such inputs, it should be like 
 checksum/secure join part1 part2
Pekr
9-Jan-2006
[394x3]
scramble-long: func [pass port][
     hash-stage1: checksum/secure pass
     hash-stage2: checksum/secure hash-stage1

     to-string xor hash-stage1 (checksum/secure port/locals/long-seed 
     hash-stage2)  ;.--- what to do here?
]
aha ...
bad handshake :-)
Volker
9-Jan-2006
[397x2]
grrr :)
Is the above your code?
  (checksum/secure port/locals/long-seed hash-stage2) 
->
  (  (checksum/secure port/locals/long-seed)  (hash-stage2) )
did you forget a join or something?
Pekr
9-Jan-2006
[399]
huh, connected? :-)
Volker
9-Jan-2006
[400]
really? :)
Pekr
9-Jan-2006
[401x3]
yes!
yes yes yes yes!!!!!!
Volker is GURU!
Volker
9-Jan-2006
[404]
Hey, congrats! So much to rebol-community ;)
Pekr
9-Jan-2006
[405]
scramble-long: func [pass port][
     hash-stage1: checksum/secure pass
     hash-stage2: checksum/secure hash-stage1

     to-string xor hash-stage1 (checksum/secure join port/locals/long-seed 
     hash-stage2)
]
Volker
9-Jan-2006
[406]
And you are a master librarian :)
Anton
9-Jan-2006
[407x3]
Well, I just logged in at the right moment... :)
Congrats.
Now to sleep...
Volker
9-Jan-2006
[410]
Goodnight Anton.
Pekr
9-Jan-2006
[411]
ufff ... :-)
Volker
9-Jan-2006
[412]
Somehow a good feeling. Specially imaging Pekr dancing around. Yes 
yes yes yes :))
Pekr
9-Jan-2006
[413x6]
:-) exactly :-)
I did not expect mysel to be able to decode simple functionality 
of the scheme. But on saturday I tried to tell myself, that maybe 
I can at least give some pointers to more skilled rebollers, to not 
hear that I am actually doing nothing ...
I prepared Ethereal to just find out, that it will not report any 
packets on localhost ;-)
without your hint to protocol internals, plust the 2x checksum/secure 
being identical to mysql docs, nothing like that would be possible 
on my side ....
no I am mid-level guru, being at least possible to narrow down the 
problem, and provide initial leads to final solution ...
now who is after NS browser-plug-in, guys? ;-)
Volker
9-Jan-2006
[419]
Yep. Without your starters i would be lost when trying to start.
Pekr
9-Jan-2006
[420]
as for NS plug-in, I provided some started too ... basically less 
than 15 funcs to wrap to have it without tricks imo ;-) I just need 
C coder for similar cooperation :-)
Volker
9-Jan-2006
[421]
This hobby c-coder would need an xp-machine, and the plugin is the 
only use i have for it..
Pekr
9-Jan-2006
[422]
you don't have windows machine?
Volker
9-Jan-2006
[423x2]
Not such a big one.
That moz-sdk seems to ned msvc, and that needs w2k or better afaik. 
Have neither that windows nor more than 128mb.
Pekr
9-Jan-2006
[425]
not sure the sdk is needed. If we are after old plug-in, not mozz 
components, then it is really few funcs to wrap ...
Volker
9-Jan-2006
[426]
Had problems with some free compilers, they did not understand the 
modern c++ in the header-files. but maybe some old moz-version could 
work.
Pekr
9-Jan-2006
[427x2]
http://www.freebyte.com/programming/cpp/#cppcompilers
http://www.bloodshed.net/dev/devcpp.html
Dockimbel
9-Jan-2006
[429x3]
it seems that there is a license issue with the new MySQL version 
:
/*

  This file is the net layer API for the MySQL client/server protocol,

  which is a tightly coupled, proprietary protocol owned by MySQL AB.
  Any re-implementations of this protocol must also be under GPL
  unless one has got an license from MySQL AB stating otherwise.
*/
I don't have problem moving my mysql driver to GPL but it may cause 
later issues for users...
Pekr
9-Jan-2006
[432]
what?