//
// ========================================================================
-// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
digest = __md.digest();
}
if (digest == null || digest.length != _digest.length) return false;
+ boolean digestMismatch = false;
for (int i = 0; i < digest.length; i++)
- if (digest[i] != _digest[i]) return false;
- return true;
+ digestMismatch |= (digest[i] != _digest[i]);
+ return !digestMismatch;
}
else if (credentials instanceof MD5)
{
MD5 md5 = (MD5) credentials;
if (_digest.length != md5._digest.length) return false;
+ boolean digestMismatch = false;
for (int i = 0; i < _digest.length; i++)
- if (_digest[i] != md5._digest[i]) return false;
- return true;
+ digestMismatch |= (_digest[i] != md5._digest[i]);
+ return !digestMismatch;
}
else if (credentials instanceof Credential)
{