Commit Graph

40 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 ffe9397e66 Fix SASLMechanism.compareTo(SASLMechanism)
Thanks to Aleksander Melnichnikov for pointing this out.
2017-02-02 16:08:37 +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
Andrey Prokopenko 2b83decc89 Handle success SASL messages containing equals sign
More strict conformance to RFC 6120 § 6.4.6, correctly handle
success SASL message which consists of a single equals sign.
Fixes SMACK-737.
2016-08-31 22:28:00 +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
Florian Schmaus 03031dfb5d Add javadoc to SASLError 2016-05-22 22:55:28 +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 710948c8f7 Add support for XEP-360: Nonzas
SMACK-682
2015-07-14 22:43:58 +02:00
Florian Schmaus 01f08e87c2 Merge branch '4.1'
Conflicts:
	smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamManager.java
	version.gradle
2015-05-24 22:36:11 +02:00
Florian Schmaus c120bc1cbc Handle empty array in SASLMechanism.authenticate()
like null array.

Thanks to Anthony Sorvari for reporting.

Fixes SMACK-670.
2015-05-22 08:24:54 +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 64d134052d Enable javadoc checkstyle
and fix violations.
2015-03-29 12:29:32 +02:00
Florian Schmaus 701aa7d9c4 Merge branch '4.1'
Conflicts:
	smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
	smack-core/src/main/java/org/jivesoftware/smack/PacketCollector.java
	smack-core/src/main/java/org/jivesoftware/smack/PacketListener.java
	smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
	smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java
	smack-core/src/main/java/org/jivesoftware/smack/packet/Packet.java
	smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java
	smack-core/src/test/java/org/jivesoftware/smack/ThreadedDummyConnection.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/address/provider/MultipleAddressesProvider.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/DataListener.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FaultTolerantNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IBBTransferNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/StreamNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/packet/PubSub.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/VCardManager.java
	smack-extensions/src/test/java/org/jivesoftware/smackx/receipts/DeliveryReceiptTest.java
	smack-im/src/main/java/org/jivesoftware/smack/chat/ChatManager.java
	smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java
	smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/provider/JingleProvider.java
	smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/UserID.java
	smack-legacy/src/main/java/org/jivesoftware/smackx/xroster/provider/RosterExchangeProvider.java
	smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
	version.gradle
2015-03-04 22:42:36 +01:00
Florian Schmaus 180a3bb4ca Fix SASL X-OAUTH2: Use Base64.encode() instead of decode() 2015-02-23 08:49:30 +01:00
Florian Schmaus 5bb4727c57 Use Jid (and subclasses) from jxmpp-jid
Fixes SMACK-634
2015-02-17 16:07:16 +01:00
Florian Schmaus bc61527bd2 Expose InterruptedException
SMACK-632
2015-02-14 14:57:33 +01:00
Florian Schmaus 86ea027301 Add StringUtils.requireNotNullOrEmpty and Objects.requireNonNull
and use this in a few places.
2015-01-26 20:47:09 +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 7e4e3699a1 Add allowEmptyOrNullUsername()
to ConnectionConfiguration.Builder().

And prepare SASL EXTERNAL for empty or null usernames.

Also clarify some parts regarding the user field.

Fixes SMACK-627
2015-01-10 11:26:15 +01:00
Florian Schmaus 9286a1decb Rework XMPP Error class design
Introduce AbstractError, change 'Conditions' to enums. Because of
AbstractError, it was necessary that PlainStreamElement and
TopLevelStreamElement becomes an interface. Thus the implementation of
TopLevelStreamElement.toString() had to be removed.

This adds

- policy-violation
- unexpected-request

to XMPPError.Condition, and removes the

- payment-required
- remote-server-error
- unexpected-condition
- request-timeout

Conditions

The file transfer code does now no longer throw XMPPErrorExceptions, but
SmackExceptions.

Fixes SMACK-608. Makes it possible to resolves SMACK-386.
2014-11-25 13:19:32 +01:00
Florian Schmaus 6e569701b3 Add support for SASL X-OAUTH2 2014-11-20 18:50:33 +01:00
Florian Schmaus 646a4a6f90 Add support for SASL failure 'text' elements
- Also move toString() into TopLevelStreamElement.
- Fix SASLFailure toXML xmlnsAttribute(NAMESPACE)
- Improve SASLFailure parsing
- And introduce XmlUnitUtils
2014-11-19 09:57:39 +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
Florian Schmaus fc51f3df48 Add support for XEP-0198: Stream Management
- De-duplicate code by moving it into AbstractXMPPConnection
- Introduce TopLevelStreamElement as superclass for all XMPP stream elements.
- Add SynchronizationPoint, ParserUtils
- Add ParserUtils

Fixes SMACK-333 and SMACK-521
2014-09-11 09:49:16 +02:00
Florian Schmaus 5d4aa76d19 Create smack.util.stringencoder for Base64, Base32,…
Use Android's Base64 implementation when on Android, otherwise, when on
Java7, use the existing one.
2014-09-04 11:07:55 +02:00
Florian Schmaus bbf89c65bf Fix typo in XmlStringBuilder, it's not an Angel
s/rightAngelBracket/rightAngleBracket/
2014-08-20 21:25:14 +02:00
Florian Schmaus 7277eb553a Enable more 'checkstyle' checks
AvoidStarImport
IllegalImport
RedundantImport
UpperEll
ArrayTypeStyle
GenericWhitespace
EmptyStatement
PackageDelcaration
2014-08-15 23:17:45 +02:00
Florian Schmaus 47a59ad7b3 Move toBytes() into SASLMechanism
as it's a often needed transformation in the SASL world.
2014-08-12 22:00:09 +02:00
Florian Schmaus f37682d980 Make SASLMechanism.getAuthenticationText() return byte[]
every SASL Mechanism is designed as a byte array based protocol. XMPP
adds the constraint that the challenges and responses are send base64
encoded. It's therefore better API design to let getAuthenticationText()
return byte[] instead of String.
2014-08-12 21:52:56 +02:00
Florian Schmaus 89dc3a0e85 Add smack-android and redesign SASL authentication
This commit marks an important milestone with the addition of the
smack-android subproject. Smack is now able to run native on Android
without requiring any modifications, which makes the aSmack build
environment obsolete.

It was necessary to redesign the code for SASL authentication to achieve
this. Smack now comes with smack-sasl-provided for SASL implementations
that do not rely on additional APIs like javax for platforms where those
APIs are not available like Android.
2014-08-01 10:34:47 +02:00
Florian Schmaus 91fa7a8219 Add missing mechanism-too-weak SASL Error 2014-06-05 20:52:10 +02:00
Florian Schmaus 91fd15ad86 Prefix subprojects with 'smack-'
instead of using the old baseName=smack appendix=project.name approach,
we are now going convention over configuration and renaming the
subprojects directories to the proper name.

Having a prefix is actually very helpful, because the resulting
libraries will be named like the subproject. And a core-4.0.0-rc1.jar is
not as explicit about what it actually *is* as a
smack-core-4.0.0-rc1.jar.

SMACK-265
2014-04-28 19:44:14 +02:00