Commit Graph

309 Commits

Author SHA1 Message Date
Paul Schaub 9f86eda532
OMEMO: converse.js compatibility 2019-08-04 15:00:25 +02:00
Florian Schmaus 12cbeede57 Use Enum.toString() in XmlStringBuilder.element(String, Enum)
as toString() is often overriden by Enums to yield the expected XMPP
wire protocol representation.
2019-08-03 22:15:44 +02:00
Florian Schmaus eecd5b70d3 Merge branch 'master' of github.com:igniterealtime/Smack 2019-07-30 11:35:45 +02:00
Florian Schmaus 8da954f7a4 OpenPGP: Bump Pgpainless to 0.0.1-alpha7
Also unify how new Security Providers are installed.

Thanks to Paul Schaub for helping with this.
2019-07-30 09:37:19 +02:00
Florian Schmaus 96e14471d0
Merge pull request #324 from adiaholic/spellcorrection
Correcting mini typing error
2019-07-28 18:11:56 +02:00
Florian Schmaus 4ca2c7cc69 Enable MissingJavadocPackage and UnnecessaryParentheses checkstyle checks 2019-07-24 09:18:39 +02:00
adiaholic fe85ab3b83 Correcting mini typing error 2019-07-09 22:12:26 +05:30
Florian Schmaus 870e6c674a Make ExceptionUtil.getStackTrace(Throwable) null safe 2019-07-04 15:47:46 +02:00
Florian Schmaus e3ec422071 Try to lookup QNAME first in XmppElementUtil.getQNameFor() 2019-06-12 22:30:56 +02:00
Florian Schmaus fa0c16d75c Introduce EqualsUtil and HashCode.(Builder|Cache) 2019-06-12 14:51:17 +02:00
Florian Schmaus 818ee8a727 Make Objects.requireNonNull() throw IllegalArgumentException
and not NullPointerException. Altough this differs from
java.util.Objects behavior, throwing an IllegalArgumentException
appears more sensible and makes it easier to catch it in Smack's
parsing function.
2019-06-11 12:47:40 +02:00
Florian Schmaus 7d59df9eed Change type of presence priority to 'Byte' 2019-06-11 12:47:39 +02:00
Florian Schmaus e911874e72 Make MultiMap use generics where sensible
I wonder why I orginally did not do it that way…
2019-06-11 12:47:39 +02:00
Florian Schmaus ce70308099 Introduce UInt(16|32) datatypes 2019-06-11 12:47:39 +02:00
Florian Schmaus b834df65e9 Add NumberUtil.requireUShort16(int) 2019-06-11 12:47:39 +02:00
Florian Schmaus b3b242f397 Add TODO comment to XmlStringBuilder 2019-06-11 12:47:39 +02:00
Florian Schmaus 4d36e3b521 Introduce FormFieldChildElement and make FormField immutable 2019-06-11 12:47:39 +02:00
Florian Schmaus 9a2cca2bd3 Merge branch 'master' of github.com:Flowdalic/Smack 2019-06-03 17:41:49 +02:00
Florian Schmaus b288768f77 Introduce util.InternetAddress
and use it where sensible. Also fixes a few unit tests along the way.
2019-06-03 17:41:10 +02:00
Florian Schmaus 619b8e6f4a Add secure(OnlineAttackSafe|Unique|OfflineAttackSafe)RandomString()
and replace usages of java.util.UUID in Smack with
secureUniqueRandomString() because it uses a thread-local secure random
number generator.
2019-06-02 20:08:03 +02:00
Florian Schmaus 839e347676 Rename NumberUtil.checkIfInUInt32Range() to requireUInt32 2019-06-02 10:46:53 +02:00
Florian Schmaus 726a2de273 Deprecate ParserUtils.getQName() 2019-06-02 10:44:50 +02:00
adiaholic f91044657f Generic Exception replaced with Type Specific Exceptions.
'parseAndProcessStanza()' throws generic Exceptions.
Since there are plenty of exceptions that should not be
catched by smack, it's better to throw Type Specific Exceptions.
This Commit is was in response to SMACK-839.
2019-05-19 17:09:01 +05:30
Florian Schmaus 04238bd36a Add CloseableUtil.maybeClose(Closeable) 2019-05-18 13:25:31 +02:00
Florian Schmaus f7762c5db7 Add "whitespace after comma" checkstyle rule 2019-05-17 21:56:46 +02:00
Florian Schmaus 49f4de0cdb Replace 'key' with QName 2019-05-08 21:10:39 +02:00
Florian Schmaus 32429bcb9c Add message to InterruptedException if blocking queue was shut down 2019-05-08 15:19:10 +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 7f0dc72dab Update errorprone(-plugin) and make Unused(Variable|Method) an error 2019-05-07 23:09:00 +02:00
Florian Schmaus 68d7d738b6 Remove all tabs and add checkstyle rule that enforces no-tabs
Fixes SMACK-866.
2019-05-07 21:24:00 +02:00
Florian Schmaus 505493d889 Add XmlStringBuilder.optAttribute(String, Number) 2019-05-07 10:18:55 +02:00
Florian Schmaus 4133eb175c Replace XPP3 by XmlPullParser interface wrapping StAX and XPP3
Introducing Smack's own XmlPullParser interface which tries to stay as
compatible as possible to XPP3. The interface is used to either wrap
StAX's XMLStreamReader if Smack is used on Java SE, and XPP3's
XmlPullParser if Smack is used on on Android.

Fixes SMACK-591.

Also introduce JUnit 5 and non-strict javadoc projects.
2019-05-06 22:10:50 +02:00
Florian Schmaus 474ea68d4a Remove unused method in Smack's Base64 API 2019-04-09 10:56:47 +02:00
Florian Schmaus 62fd897cf7 Add support for XEP-0418: DNS Queries over XMPP (DoX)
Fixes SMACK-862.
2019-04-09 10:56:47 +02:00
Florian Schmaus 1122bf394c Add ExceptionUtil 2019-04-09 09:33:32 +02:00
Florian Schmaus 7d5274dad1 Use java.util.Base64 and remove build-in Base64 API 2019-04-09 09:33:32 +02:00
Florian Schmaus 89c0fa4b99 Let StringUtils.(insecure)randomString() return empty string
in case length is zero. Also do throw a NegativeArraySizeException if
length is negative instead of returning null.

This fixes the following sporadic test issue:

org.jivesoftware.smackx.ox.PainlessOpenPgpProviderTest > encryptDecryptTest FAILED
java.lang.AssertionError
at org.jivesoftware.smack.util.XmlStringBuilder.escape(XmlStringBuilder.java:425)
at org.jivesoftware.smackx.ox.element.EncryptedOpenPgpContentElement.addCommonXml(EncryptedOpenPgpContentElement.java:65)
at org.jivesoftware.smackx.ox.element.CryptElement.toXML(CryptElement.java:51)
at org.jivesoftware.smackx.ox.element.CryptElement.toXML(CryptElement.java:31)
at org.jivesoftware.smack.packet.Element.toXML(Element.java:41)
at org.jivesoftware.smackx.ox.element.OpenPgpContentElement.toInputStream(OpenPgpContentElement.java:186)
at org.jivesoftware.smackx.ox.crypto.PainlessOpenPgpProvider.encrypt(PainlessOpenPgpProvider.java:136)
at org.jivesoftware.smackx.ox.PainlessOpenPgpProviderTest.encryptDecryptTest(PainlessOpenPgpProviderTest.java:155)

because EncryptedOpenPgpContentElement rpad field was sometimes
'null' in case the random function returned '0' as length.
2019-03-25 18:58:58 +01:00
Florian Schmaus 14f288a763 Introduce RandomUtil
and use it in EncryptedOpenPgpContentElement
2019-03-25 18:58:58 +01:00
Florian Schmaus 488e20476e Improve message of StressTestFailedException.NotAllMessagesReceivedException 2019-02-17 21:47:16 +01:00
Florian Schmaus b3ed9bc29f Add BooleansUtils 2019-02-17 18:21:57 +01:00
Florian Schmaus 8df69bd3ce Use XmlEnvironment in parsing/provider subsystem 2019-02-15 23:21:30 +01:00
Florian Schmaus 7dee3b88a2 Introduce SmackParsingException 2019-02-10 19:01:47 +01:00
Florian Schmaus 083dac8b83 Rework exceptions in the parsing / provider subsystem 2019-02-05 13:18:03 +01:00
Florian Schmaus fee3ed81ca Introduce XmlEnvironment 2019-02-05 13:18:03 +01:00
Florian Schmaus 5705f18f58 Remove SmackDaneVerifier.finish(SSLSocket) 2019-02-05 13:18:03 +01:00
Florian Schmaus 658fd08d20 Use try-with-resources where possible
and make StanzaCollector implement AutoCloseable.
2019-02-05 13:18:03 +01:00
Florian Schmaus e98d42790a SmackReactor/NIO, Java8/Android19, Pretty print XML, FSM connections
This commit adds
- SmackReactor / NIO
- a framework for finite state machine connections
- support for Java 8
- pretty printed XML debug output

It also
- reworks the integration test framework
- raises the minimum Android API level to 19
- introduces XmppNioTcpConnection

Furthermore fixes SMACK-801 (at least partly). Java 8 language
features are available, but not all runtime library methods. For that
we would need to raise the Android API level to 24 or higher.
2019-02-05 13:18:03 +01:00
Florian Schmaus 62a0c6f26e Merge branch '4.3' 2018-11-29 22:39:55 +01:00
Florian Schmaus 7ea7f9e2e9 Add ParserUtils.parseXmlBoolean(String) 2018-11-29 09:02:05 +01:00
Georg Lukas 229653af30 ParserUtils: fix boolean parser
How could this even happen?

Signed-off-by: Georg Lukas <georg@op-co.de>
2018-11-28 11:11:52 +01:00