Skip to content
Snippets Groups Projects
Commit 6809ef62 authored by deuce's avatar deuce
Browse files

Create the BinkP.cram object during accept() as well as during connect()

parent 59bc8577
No related branches found
No related tags found
No related merge requests found
......@@ -314,6 +314,13 @@ BinkP.prototype.accept = function(sock, auth_cb)
for (i=0; i<128; i++)
challenge += random(16).toString(16);
// Avoid warning from syncjslint by putting this in a closure.
function hex2ascii(hex)
{
return ascii(parseInt(hex, 16));
}
this.cram = {algo:'MD5', challenge:challenge.replace(/[0-9a-fA-F]{2}/g, hex2ascii)};
this.authenticated = undefined;
this.sendCmd(this.command.M_NUL, "OPT CRAM-MD5-"+challenge);
this.sendCmd(this.command.M_NUL, "SYS "+this.system_name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment