Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/passport-http/strategies/digest.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ DigestStrategy.prototype.authenticate = function(req) {
if (typeof password === 'object' && password.ha1) {
ha1 = password.ha1;
} else {
ha1 = md5(creds.username + ":" + creds.realm + ":" + password);
ha1 = md5(user.username + ":" + creds.realm + ":" + password);
}
} else if (creds.algorithm === 'MD5-sess') {
// TODO: The nonce and cnonce used here should be the initial nonce
Expand All @@ -147,7 +147,7 @@ DigestStrategy.prototype.authenticate = function(req) {
// resulting session key needs to be investigated.
//
// See RFC 2617 (Section 3.2.2.2) for further details.
ha1 = md5(md5(creds.username + ":" + creds.realm + ":" + password) + ":" + creds.nonce + ":" + creds.cnonce);
ha1 = md5(md5(user.username + ":" + creds.realm + ":" + password) + ":" + creds.nonce + ":" + creds.cnonce);
} else {
return self.fail(400);
}
Expand Down