Commit Graph

10 Commits

Author SHA1 Message Date
Florian Schmaus b7ea226c56 Bump "Error Prone" to 2.3.2
and gradle-errorprone-plugin to 0.6.
2018-10-31 16:06:31 +01:00
Florian Schmaus 43715460c6 Fix SASL SCRAM-SHA-1(-PLUS) priority
Fixes SMACK-749.

Thanks to Grigory Fedorov for reporting this and to Kim Alvefur for
helping to diagnose the issue.
2017-03-18 17:49:38 +01:00
Florian Schmaus 1f1bc236fd Ads support for SCRAM-SHA-1-PLUS
Related to SMACK-398.
2016-11-20 19:34:17 +01:00
Florian Schmaus 44744de003 Prepare SASL SCRAM API for other hash functions 2016-11-20 15:28:02 +01:00
Florian Schmaus e71d159b96 Smack 4.1.9
-----BEGIN PGP SIGNATURE-----
 
 iQF8BAABCgBmBQJYMZ8OXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
 ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ5Nzc1MDU5RjNBMjFEQ0UxNkJFNEZCQUUy
 MjM5QTdFOEY1ODUyMDUyAAoJECI5p+j1hSBSK88H/0L0gxM9Pb4Eki4KLi0iUuMy
 QtP0L7r4uLkZxgmOx7pmkY84jIRhkO2zQYubdK4qBzcGzQapHU5J6wOy/HCVVgp7
 Roys1krA3hT0sNL+jnDvsnGU1nc5eb4TftP6ie9mm2Io0nYLoMrWfgxK7FN3xUj/
 3tQn3cpkH5yIWHkaokXS45BHQEXm+uy7gvV/yqcjziyopKnsbvERLudQzFLBz+0w
 z/vljq0W0k22nrLc8syaLhgmY7uyeksqmPXC0EctMgI6HxuJyaFFwtZbATnyzfpk
 1+45QcoSkgw/2u03gZPThj/Pk0nV5h1feKYw/ZUx3VWd4UCd5cjM2on4zzWEro0=
 =OkN/
 -----END PGP SIGNATURE-----

Merge tag '4.1.9'

Smack 4.1.9
2016-11-20 14:53:44 +01:00
Florian Schmaus fca2f59e08 Fix SCRAM-SHA1 mechanism creating invalid c-nonce
Because of the condition "c >= 32", Smack would possible return a
c-nonce containing ASCII whitespace characters (32d, 0x20), which are
not allowed in the c-nonce as per RFC 5802.

This commit applies the correct condition: "c > 32".

Fixes SMACK-735.
2016-10-20 17:00:52 +02:00
Dave Cridland 9c772add93 SASL Proxy Auth support
This adds the ability to provide a distinct authorization identifier for use
by SASL mechanisms. Not all SASL mechanisms support this operation, in
particular CRAM-MD5.

Both the javax and provided SASL implementations are extended, and an authzid
parameter added to the authenticate method.

The authorization identifier is passed as a EntityBareJid in order to assure the
correct form.

Resolves SMACK-677.

Minor-Modifications-By: Florian Schmaus <flo@geekplace.eu>
2015-09-21 20:39:23 +02:00
Florian Schmaus 7aa784a494 SCRAM-SHA1: Always calculate serverSignature
Otherwise we may get an NPE if the key was cached:

Connection closed with error java.lang.NullPointerException: Attempt to get length of null array
	at org.jivesoftware.smack.util.stringencoder.Base64.encodeToString(Base64.java:43)
	at org.jivesoftware.smack.sasl.core.SCRAMSHA1Mechanism.evaluateChallenge(SCRAMSHA1Mechanism.java:201)
	at org.jivesoftware.smack.sasl.SASLMechanism.challengeReceived(SASLMechanism.java:230)
 	at org.jivesoftware.smack.SASLAuthentication.challengeReceived(SASLAuthentication.java:328)
 	at org.jivesoftware.smack.SASLAuthentication.authenticated(SASLAuthentication.java:347)
 	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPConnection.java:894)
 	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:909)
 	at java.lang.Thread.run(Thread.java:818)
2015-01-26 07:54:13 +01:00
Florian Schmaus fe3dcba9b2 Fix javadoc warnings and deprecated methods 2014-11-02 12:12:56 +01:00
Florian Schmaus 403ecff2b2 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
2014-10-21 15:03:48 +02:00