Commit Graph

74 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 91337150e7 [sasl] Rename getChannelBindingName() to getGs2CbindFlag()
As this returns the value of the SCRAM gs2-cbind-flag.
2020-07-02 13:07:17 +02: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 f7762c5db7 Add "whitespace after comma" checkstyle rule 2019-05-17 21:56:46 +02:00
Florian Schmaus d2f5efcb20 Use StandardCharsets.(UTF_8|US_ASCII)
This also gets rid of a ton of UnsupportedEncodingException s.
2019-05-08 12:44:48 +02:00
Florian Schmaus b51a6c54e8 Introduce SmackSaslException 2019-02-10 21:50:39 +01:00
Florian Schmaus fee3ed81ca Introduce XmlEnvironment 2019-02-05 13:18:03 +01:00
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
Paul Schaub 74bebc13e6
requireNotNullOrEmpty -> requireNotNullNorEmpty 2018-07-17 15:10:39 +02: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 5ab2903c32 Change Element.toXml() to toXml(String enclosingNamespace) 2018-04-27 10:05:25 +02:00
Florian Schmaus a9ca1a0989 Enable ModifierOrder checkstyle check
Fixes SMACK-812
2018-03-29 12:35:11 +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 431e5b3c67 Merge branch '4.2' into master-paul-merged 2017-12-17 11:16:02 +01:00
Paul Schaub cb18056613 Fix minor codestyle issues 2017-12-17 11:03:46 +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 3d1cf61caf Add comment to ScramMechanism.getChannelBindingName() 2017-03-18 17:49:38 +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 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 1cc9cec677 Use thread local variables for (Secure)Randoms 2017-03-10 17:55:07 +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 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