mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 01:29:38 +02:00
Ads support for SCRAM-SHA-1-PLUS
Related to SMACK-398.
This commit is contained in:
parent
44744de003
commit
1f1bc236fd
14 changed files with 252 additions and 63 deletions
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright © 2014 Florian Schmaus
|
||||
* Copyright © 2014-2016 Florian Schmaus
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -17,15 +17,14 @@
|
|||
package org.jivesoftware.smack.sasl;
|
||||
|
||||
import org.jivesoftware.smack.DummyConnection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
|
||||
public class AbstractSaslTest {
|
||||
|
||||
protected final XMPPConnection xmppConnection = new DummyConnection();
|
||||
protected final DummyConnection xmppConnection = new DummyConnection();
|
||||
protected final SASLMechanism saslMechanism;
|
||||
|
||||
protected AbstractSaslTest(SASLMechanism saslMechanism) {
|
||||
this.saslMechanism = saslMechanism.instanceForAuthentication(xmppConnection);
|
||||
this.saslMechanism = saslMechanism.instanceForAuthentication(xmppConnection, xmppConnection.getConfiguration());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ public class DigestMd5SaslTest extends AbstractSaslTest {
|
|||
if (useAuthzid) {
|
||||
authzid = JidCreate.entityBareFrom("shazbat@xmpp.org");
|
||||
}
|
||||
saslMechanism.authenticate("florian", "irrelevant", JidCreate.domainBareFrom("xmpp.org"), "secret", authzid);
|
||||
saslMechanism.authenticate("florian", "irrelevant", JidCreate.domainBareFrom("xmpp.org"), "secret", authzid, null);
|
||||
byte[] response = saslMechanism.evaluateChallenge(challengeBytes);
|
||||
String responseString = new String(response);
|
||||
String[] responseParts = responseString.split(",");
|
||||
|
|
|
@ -48,9 +48,9 @@ public class SCRAMSHA1MechanismTest extends SmackTestSuite {
|
|||
}
|
||||
};
|
||||
|
||||
mech.authenticate(USERNAME, "unusedFoo", JidTestUtil.DOMAIN_BARE_JID_1, PASSWORD, null);
|
||||
mech.authenticate(USERNAME, "unusedFoo", JidTestUtil.DOMAIN_BARE_JID_1, PASSWORD, null, null);
|
||||
AuthMechanism authMechanism = con.getSentPacket();
|
||||
assertEquals((new SCRAMSHA1Mechanism().getName()), authMechanism.getMechanism());
|
||||
assertEquals(SCRAMSHA1Mechanism.NAME, authMechanism.getMechanism());
|
||||
assertEquals(CLIENT_FIRST_MESSAGE, saslLayerString(authMechanism.getAuthenticationText()));
|
||||
|
||||
mech.challengeReceived(Base64.encode(SERVER_FIRST_MESSAGE), false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue