2014-11-12 20:35:44 +00:00
|
|
|
package eu.siacs.conversations.crypto.sasl;
|
|
|
|
|
2020-12-30 14:57:42 +00:00
|
|
|
import org.bouncycastle.crypto.Digest;
|
2014-11-12 20:35:44 +00:00
|
|
|
import org.bouncycastle.crypto.digests.SHA1Digest;
|
|
|
|
import org.bouncycastle.crypto.macs.HMac;
|
|
|
|
|
|
|
|
import java.security.SecureRandom;
|
|
|
|
|
|
|
|
import eu.siacs.conversations.entities.Account;
|
|
|
|
import eu.siacs.conversations.xml.TagWriter;
|
|
|
|
|
2017-01-12 20:26:58 +00:00
|
|
|
public class ScramSha1 extends ScramMechanism {
|
2020-12-30 14:57:42 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected HMac getHMAC() {
|
|
|
|
return new HMac(new SHA1Digest());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected Digest getDigest() {
|
|
|
|
return new SHA1Digest();
|
2014-11-12 20:35:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public ScramSha1(final TagWriter tagWriter, final Account account, final SecureRandom rng) {
|
|
|
|
super(tagWriter, account, rng);
|
|
|
|
}
|
|
|
|
|
2014-11-15 14:42:40 +00:00
|
|
|
@Override
|
|
|
|
public int getPriority() {
|
|
|
|
return 20;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getMechanism() {
|
2014-11-12 20:35:44 +00:00
|
|
|
return "SCRAM-SHA-1";
|
|
|
|
}
|
|
|
|
}
|