Commit Graph

17 Commits

Author SHA1 Message Date
Florian Schmaus 4c646436a5 Bump "Error Prone" to 2.0.15
and fix a few things :)
2017-02-11 16:16:41 +01:00
Florian Schmaus 183c605278 Bump JXMPP to 0.5.0 2017-01-02 09:40:46 +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
Florian Schmaus 1f87185ee8 Do not base64 twice in SASL X-OAUTH2
Fixes SMACK-722.
2016-07-04 08:25:01 +02:00
Florian Schmaus ac5d9d56c6 Do not base64 twice in SASL X-OAUTH2
Fixes SMACK-722.
2016-06-01 13:10:11 +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 9354e4fb74 Rework and improve authentication API and internals
Add

- performSaslAnonymousAuthentication()
- performSaslExternalAuthentication(SSLContext)
- addEnabledSaslMechanism(String)
- addEnabledSaslMechanisms(Collection<String>)

to ConnectionConfiguration.Builder.

Instead of providing a special API call for anonymous authentication,
Smack now has a configuration builder method to set anonymous/external
authentication. This also removes a lot of duplicate code within
Smack.

Also move SASLAnonymous into o.j.smack.sasl.core.

Fixes SMACK-629.
2015-05-03 22:00:41 +02:00
Florian Schmaus de528eee67 Add JavadocPackage checkstyle
change from package.html to package-info.java. Add missing
package-info.java with a placeholder description.
2015-04-04 17:16:47 +02:00
Florian Schmaus 180a3bb4ca Fix SASL X-OAUTH2: Use Base64.encode() instead of decode() 2015-02-23 08:49:30 +01: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 ed67ed8e11 SASL, username and password related javadoc improvements 2015-01-18 20:42:27 +01:00
Florian Schmaus 6e569701b3 Add support for SASL X-OAUTH2 2014-11-20 18:50:33 +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