Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

httpntlm

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

httpntlm - npm Package Compare versions

Comparing version 1.7.1 to 1.7.3

5

httpntlm.js

@@ -8,3 +8,3 @@ /**

*/
'use strict';

@@ -75,3 +75,4 @@

// parse type2 message from server:
var type2msg = ntlm.parseType2Message(res.headers['www-authenticate']);
var type2msg = ntlm.parseType2Message(res.headers['www-authenticate'], callback); //callback only happens on errors
if(!type2msg) return; // if callback returned an error, the parse-function returns with null

@@ -78,0 +79,0 @@ // create type3 message:

20

ntlm.js

@@ -8,3 +8,3 @@ /**

*/
var crypto = require('crypto');

@@ -106,5 +106,7 @@

buf.write(workstation, pos, workstation.length, 'ascii'); pos += workstation.length; // workstation string
buf.write(domain , pos, domain.length , 'ascii'); pos += domain.length;
// length checks is to fix issue #46 and possibly #57
if(workstation.length !=0) buf.write(workstation, pos, workstation.length, 'ascii'); pos += workstation.length; // workstation string
if(domain.length !=0) buf.write(domain , pos, domain.length , 'ascii'); pos += domain.length; // domain string
return 'NTLM ' + buf.toString('base64');

@@ -115,4 +117,6 @@ }

var match = rawmsg.match(/NTLM (.+)?/);
if(!match || !match[1])
return callback(new Error("Couldn't find NTLM in the message type2 comming from the server"));
if(!match || !match[1]) {
callback(new Error("Couldn't find NTLM in the message type2 comming from the server"));
return null;
}

@@ -126,4 +130,6 @@ var buf = new Buffer(match[1], 'base64');

if(msg.type != 2)
return callback(new Error("Server didn't return a type 2 message"));
if(msg.type != 2) {
callback(new Error("Server didn't return a type 2 message"));
return null;
}

@@ -130,0 +136,0 @@ msg.targetNameLen = buf.readInt16LE(12);

{
"name": "httpntlm",
"description": "httpntlm is a Node.js library to do HTTP NTLM authentication",
"version": "1.7.1",
"version": "1.7.3",
"dependencies": {

@@ -6,0 +6,0 @@ "httpreq": ">=0.4.22",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc