Commit Graph

42 Commits

Author SHA1 Message Date
Florian Schmaus 92f4aadfdc [sasl] Avoid mechanisms that need a password when none is available 2021-03-25 15:01:15 +01:00
Florian Schmaus eb4c2c5572 s/occured/occurred/ 2019-10-30 12:02:36 +01:00
Florian Schmaus eeb6c52f7e Move SASL logic into AbstractXMPPConnection
Besides the way the transport handles the stream after SASL
<success/>, the SASL logic is independend from the underlying
transport (BOSH, TCP, …). Hence move it up into
AbstractXMPPConnection.

This also has the benefit that we can make some more methods private
or package-private.

Also introduce XmlStringBuilder.optTextChild(), which causes some
associated changes.
2019-09-25 13:49:21 +02:00
Florian Schmaus 3ee4dd7b3a Move SASL authentication state into SASLMechanism 2019-09-24 10:19:12 +02:00
Florian Schmaus 1a3067c89b Enable werror for javadoc and fix javadoc issues 2019-08-30 12:08:30 +02:00
Florian Schmaus ca7529c192 Use Integer.compare(int, int) now that we are on Android 19 2019-08-04 23:03:42 +02:00
Florian Schmaus 4ca2c7cc69 Enable MissingJavadocPackage and UnnecessaryParentheses checkstyle checks 2019-07-24 09:18:39 +02:00
Florian Schmaus 91ec6cc955 Javadoc changes for Java 11 compatibility 2019-07-19 23:05:46 +02:00
Florian Schmaus b51a6c54e8 Introduce SmackSaslException 2019-02-10 21:50:39 +01:00
Florian Schmaus a22ec4b112 Use java.text.Normalizer for SASLPrep 2018-05-10 20:30:23 +02:00
Florian Schmaus e8923b9d16 Enable trailing whitespace checkstyle check
for all source code regions, including javadoc.
2018-05-09 23:26:39 +02:00
Florian Schmaus b5209f4701 Enable RedundantModifier checkstyle check 2018-03-28 14:02:21 +02:00
Florian Schmaus 3c4225d167 Merge branch '4.2' 2017-12-25 14:16:43 +01:00
Florian Schmaus 34373e8710 Enable javadoc 'html' doclint
Also make all 'test' tasks depend on the 'javadoc' task.

Fixes SMACK-650.
2017-12-25 14:08:18 +01:00
Florian Schmaus 0eeab74990 Merge branch '4.2' 2017-12-25 11:40:45 +01:00
Paul Schaub 52398b535f
Fix javadoc issues in some packages 2017-12-23 20:21:19 +01:00
Florian Schmaus 2a97d7c5ea Don't reinvent methods in HashManager
use the existing API from StringUtils instead.

Also rename StringUtils.toBytes() to 'toUtf8Bytes()'.
2017-08-16 14:55:25 +02:00
Florian Schmaus 08e897113d Add CustomImportOrder checkstyle rule
And matching ImportOrder settings for Eclipse in
resources/eclipse/smack.importorder
2017-06-14 17:12:43 +02:00
Florian Schmaus ce1cddc722 More checkstyle whitespace related checks 2017-05-24 14:42:38 +02:00
Florian Schmaus 762939068b Add javadoc for SASLMechanism.getPriority() 2017-03-18 17:49:38 +01:00
Florian Schmaus de783dce73 Add SASLMechanism.toString() 2017-03-18 17:49:38 +01:00
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 1f1bc236fd Ads support for SCRAM-SHA-1-PLUS
Related to SMACK-398.
2016-11-20 19:34:17 +01: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
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 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 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 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 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 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
Renamed from core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java (Browse further)