-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tcl pbkdf2 function #1569
Add tcl pbkdf2 function #1569
Conversation
I'm starting to dig into this in-depth, but a few initial suggestions. Could you please...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great feature to add!
done
done
not sure, thats a good idea, because then pbkdf2.c and tclpbkdf2.c would mutually depend on each other. If you still want, i could add a shared header file to make such "separation". |
done, tcl funcs separated into tclpbkdf2.c |
note for merge- run makedepend |
As a real world test, can you hack this into grawity's script and confirm it works as expected? |
this PR does not need makedepend |
Found by: grawity
Patch by: michaelortmann
Fixes:
One-line summary:
Add tcl pbkdf2 function
Additional description (if needed):
Useful for tcl scripts like https://github.com/grawity/eggdrop-sasl/blob/master/README.md#scram-sha-support that add SASL SCRAM mechanism, where the author said "which is very slow in Tcl so the server may time out". So this PR will help the author out with a fast replacement function exported by eggdrop. hope that helps and cheerz to grawity for his great work :)
The new tcl function pbkdf2() returns as hexadecimal string by default and -bin by option, which is similar, to what tcllibs sha256() does (older tcllibs md5 had it the other way around), see https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/modules/sha1/sha256.md
Test cases demonstrating functionality (if applicable):
Benchmark times were measured with #1568 applied
Benchmark and Result of external tcl script providing pbkdf2():
user 514.968ms sys 0.000ms
Benchmark and result of new pmkdf2 mod function providing pbkdf2():
user 0.510ms sys 0.000ms
Test and demo of replacement function for grawities script:
orig func:
replacement func:
see also:
https://github.com/grawity/eggdrop-sasl/blob/master/g_scram.tcl#L156