Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!challengeMatch) {
return callback(this._formatError('Invalid login sequence while waiting for server challenge string', 'EAUTH', str, 'AUTH NTLM'));
} else {
challengeString = challengeMatch[1];
}
if (!/^NTLM/i.test(challengeString)) {
challengeString = 'NTLM ' + challengeString;
}
let type2Message = ntlm.parseType2Message(challengeString, callback);
if (!type2Message) {
return;
}
let type3Message = ntlm.createType3Message(type2Message, {
domain: this._auth.domain || '',
workstation: this._auth.workstation || '',
username: this._auth.user,
password: this._auth.pass
});
type3Message = type3Message.substring(5); // remove the "NTLM " prefix
this._responseActions.push(str => {
this._actionAUTH_NTLM_TYPE3(str, callback);
});
this._sendCommand(type3Message);
}
if (!challengeMatch) {
return callback(this._formatError('Invalid login sequence while waiting for server challenge string', 'EAUTH', str, 'AUTH NTLM'));
} else {
challengeString = challengeMatch[1];
}
if (!/^NTLM/i.test(challengeString)) {
challengeString = 'NTLM ' + challengeString;
}
var type2Message = ntlm.parseType2Message(challengeString, callback);
if (!type2Message) {
return;
}
var type3Message = ntlm.createType3Message(type2Message, {
domain: this._auth.domain || '',
workstation: this._auth.workstation || '',
username: this._auth.user,
password: this._auth.pass
});
type3Message = type3Message.substring(5); // remove the "NTLM " prefix
this._responseActions.push(function (str) {
this._actionAUTH_NTLM_TYPE3(str, callback);
}.bind(this));
this._sendCommand(type3Message);
};