Merge branch 'jetty-9.4.x' into jetty-10.0.x
This commit is contained in:
commit
be9ca8aa5d
|
@ -105,7 +105,7 @@ public abstract class Credential implements Serializable
|
|||
int l1 = known.length();
|
||||
int l2 = unknown.length();
|
||||
for (int i = 0; i < l2; ++i)
|
||||
result &= known.charAt(i%l1) == unknown.charAt(i);
|
||||
result &= ((l1==0)?unknown.charAt(l2-i-1):known.charAt(i%l1)) == unknown.charAt(i);
|
||||
return result && l1 == l2;
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ public abstract class Credential implements Serializable
|
|||
int l1 = known.length;
|
||||
int l2 = unknown.length;
|
||||
for (int i = 0; i < l2; ++i)
|
||||
result &= known[i%l1] == unknown[i];
|
||||
result &= ((l1==0)?unknown[l2-i-1]:known[i%l1]) == unknown[i];
|
||||
return result && l1 == l2;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,13 +20,13 @@
|
|||
package org.eclipse.jetty.util.security;
|
||||
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.eclipse.jetty.util.security.Credential.Crypt;
|
||||
import org.eclipse.jetty.util.security.Credential.MD5;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
|
||||
/**
|
||||
* CredentialTest
|
||||
|
@ -94,4 +94,20 @@ public class CredentialTest
|
|||
assertFalse(Credential.byteEquals("foo".getBytes(),"fo".getBytes()));
|
||||
assertFalse(Credential.byteEquals("foo".getBytes(),"bar".getBytes()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyString()
|
||||
{
|
||||
assertFalse(Credential.stringEquals("fooo",""));
|
||||
assertFalse(Credential.stringEquals("","fooo"));
|
||||
assertTrue(Credential.stringEquals("",""));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyBytes()
|
||||
{
|
||||
assertFalse(Credential.byteEquals("fooo".getBytes(),"".getBytes()));
|
||||
assertFalse(Credential.byteEquals("".getBytes(),"fooo".getBytes()));
|
||||
assertTrue(Credential.byteEquals("".getBytes(),"".getBytes()));
|
||||
}
|
||||
}
|
||||
|
|
57
pom.xml
57
pom.xml
|
@ -509,63 +509,6 @@
|
|||
<link>http://docs.oracle.com/javase/8/docs/api/</link>
|
||||
<link>http://docs.oracle.com/javaee/7/api/</link>
|
||||
</links>
|
||||
<tags>
|
||||
<tag>
|
||||
<name>org.apache.xbean.XBean</name>
|
||||
<placement>X</placement>
|
||||
<head />
|
||||
</tag>
|
||||
<tag>
|
||||
<name>phase</name>
|
||||
<placement>t</placement>
|
||||
<head>Phase:</head>
|
||||
</tag>
|
||||
<tag>
|
||||
<name>goal</name>
|
||||
<placement>t</placement>
|
||||
<head>Goal:</head>
|
||||
</tag>
|
||||
<tag>
|
||||
<name>description</name>
|
||||
<placement>a</placement>
|
||||
<head>Description:</head>
|
||||
</tag>
|
||||
<tag>
|
||||
<name>parameter</name>
|
||||
<placement>f</placement>
|
||||
<head>Parameter:</head>
|
||||
</tag>
|
||||
<tag>
|
||||
<name>required</name>
|
||||
<placement>f</placement>
|
||||
<head>Required:</head>
|
||||
</tag>
|
||||
<tag>
|
||||
<name>readonly</name>
|
||||
<placement>f</placement>
|
||||
<head>Read-Only:</head>
|
||||
</tag>
|
||||
<tag>
|
||||
<name>execute</name>
|
||||
<placement>X</placement>
|
||||
<head />
|
||||
</tag>
|
||||
<tag>
|
||||
<name>requiresDependencyResolution</name>
|
||||
<placement>X</placement>
|
||||
<head />
|
||||
</tag>
|
||||
<tag>
|
||||
<name>requiresProject</name>
|
||||
<placement>X</placement>
|
||||
<head />
|
||||
</tag>
|
||||
<tag>
|
||||
<name>threadSafe</name>
|
||||
<placement>X</placement>
|
||||
<head />
|
||||
</tag>
|
||||
</tags>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
Loading…
Reference in New Issue