1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 17:19:39 +02:00

Add SCRAM-SHA1 support

Thanks to Stefan Karlsson for helping with the implementation.

Also add SASLMechanism.checkIfSuccessfulOrThrow(), to increase the
security by verifying the mechanisms state at the end of SASL
authentication.

SASLMechanism now has a SASLPrep StringTransformer.

Refactor SHA1 functions out of StringUtils into SHA1 utility class.

Add MAC utility class.

Make DummyConnection getSentpacket() methods use generics to make unit
testing SCRAM-SHA1 easier.

Fixes SMACK-398
This commit is contained in:
Florian Schmaus 2014-10-21 11:59:11 +02:00
parent 6a2bc0c02d
commit 403ecff2b2
18 changed files with 704 additions and 80 deletions

View file

@ -41,6 +41,13 @@ public abstract class SASLJavaXMechanism extends SASLMechanism {
@Override
public abstract String getName();
@Override
public final void checkIfSuccessfulOrThrow() throws SmackException {
if (!sc.isComplete()) {
throw new SmackException(getName() + " was not completed");
}
}
@Override
protected void authenticateInternal()
throws SmackException {