Skip to content

Commit fd5f3fb

Browse files
committed
Update on DigestAuthentication unit test
1 parent 03bd67a commit fd5f3fb

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

restcomm/restcomm.commons/src/test/java/org/restcomm/connect/commons/DigestAuthenticationTest.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,22 @@
2626
import java.util.HashMap;
2727
import java.util.Map;
2828

29+
import static org.junit.Assert.assertEquals;
2930
import static org.junit.Assert.assertTrue;
3031

3132
public class DigestAuthenticationTest {
3233

3334
private String client = "alice0000000";
3435
private String domain = "org0000000.restcomm.com";
3536
private String password = "1234";
36-
private String proxyAuthHeader = "Digest username=\"alice0000000\"," +
37-
"realm=\"org0000000.restcomm.com\"," +
38-
"cnonce=\"6b8b4567\"," +
39-
"nc=00000001," +
40-
"qop=auth,uri=\"sip:172.31.44.214:5080\"," +
41-
"nonce=\"39656532346436332d633335612d346\"," +
42-
"response=\"00e135e06e2474d1d0318fb66a2bc473\"," +
43-
"algorithm=MD5\n";
37+
private String proxyAuthHeader = "Digest username=\"alice0000000\",realm=\"org0000000.restcomm.com\",cnonce=\"6b8b4567\",nc=00000001,qop=auth,uri=\"sip:172.31.45.30:5080\",nonce=\"61343361383534392d633237372d343\",response=\"bc322276e42a123c53c2ed6f53d5e7c7\",algorithm=MD5";
4438

4539
@Test
4640
public void testAuth(){
4741
String hashedPass = DigestAuthentication.HA1(client, domain, password, "MD5");
4842

43+
assertEquals("9b11a2924d0881aca84f9db97f834d99", hashedPass);
44+
4945
assertTrue(permitted(proxyAuthHeader, "INVITE", hashedPass));
5046

5147
}

0 commit comments

Comments
 (0)