Permalink
Browse files

Keep IE from finding object methods

When using SCRAM SHA1 auth in IE, it finds (array) methods when iterating
over via 'for i in object'. Adding a hasOwnProperty check makes IE proceed
with the authentication.
  • Loading branch information...
cajus committed Aug 31, 2016
1 parent a137d8d commit 067415788dd9990923d589e2d0b4554fe83eea40
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/JSJaCConnection.js
View
@@ -860,8 +860,10 @@ JSJaCConnection.prototype._doSASLAuthScramSha1S1 = function(el) {
var data = {};
var fields = serverFirstMessage.split(',');
for(var field in fields) {
var val = fields[field].substring(2);
data[fields[field].substring(0, 1)] = val;
if (fields.hasOwnProperty(field)) {
var val = fields[field].substring(2);
data[fields[field].substring(0, 1)] = val;
}
}
var password = str2rstr_utf8(this.pass);
@@ -912,8 +914,10 @@ JSJaCConnection.prototype._doSASLAuthScramSha1S2 = function (el) {
var data = {};
var fields = serverFinalMessage.split(',');
for(var field in fields) {
var val = fields[field].substring(2);
data[fields[field].substring(0, 1)] = val;
if (fields.hasOwnProperty(field)) {
var val = fields[field].substring(2);
data[fields[field].substring(0, 1)] = val;
}
}
var serverKey = rstr_hmac_sha1(this._saltedPassword, 'Server Key');

0 comments on commit 0674157

Please sign in to comment.