Commit Graph

533 Commits

Author SHA1 Message Date
Florian Schmaus 08c228ef99 Merge branch '4.2' 2017-03-20 14:57:42 +01: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 b6f7d019c7 Use SASLMechanism.toString() in getRegisterdSASLMechanisms()
of SASLAuthentication.
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 dcac9531e7 Fix SASLAuthentication.getRegisteredSASLMechanisms
by using a LinkedHashMap which is insertion-ordered as compared to
HashMap.
2017-03-18 17:48:52 +01:00
Florian Schmaus 3640339073 Fix ConnectionConfiguration.getEnabledSaslMechanisms()
in case enabledSaslMechanisms is null, because then unmodifiableSet()
will throw an NPE.

Thanks to Nándor Holozsnyák for reporting.
2017-03-15 21:25:37 +01:00
Florian Schmaus 525feaa161 Add SynchronizationPoint.getFailureException() 2017-03-13 07:37:40 +01:00
Florian Schmaus 1a93b448db Smack 4.2.0
-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAljDKBtfFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFJB7Qf6AlkwpzMqq1g18jzEBFVX/3Sk2QWivEY7t3EhGuSguan2VIfd1fL0P85Q
 vLBm6Pw93haIxHXKRUKc8DINwP9yuRMvUotCN2hYVgfqfByHGhDCJLTNZ9atncL5
 JToptfhdRy6kgljVZPtpXOMXKBvaO3QOuTuC5cmz8PlidsYw0yUnliPLQ36uPRWX
 eaEXXbgmkjJh35WjsaafD/uM86OCqZahfvEf3e8bkPzdAayd0OKU67+v0ArA9P2E
 CiRU5vfco/vt2Qo41aLLIEOjSFfVX6Xh/pXxfQvInMAxies0KRLi5vonOmfrWRmi
 uIblzcYRXCSaZSgVN2yF8KzmF4pzcw==
 =qETn
 -----END PGP SIGNATURE-----

Merge tag '4.2.0'

Smack 4.2.0
2017-03-10 23:35:06 +01:00
Florian Schmaus 1cc9cec677 Use thread local variables for (Secure)Randoms 2017-03-10 17:55:07 +01:00
Florian Schmaus 09b6608a3a Fix and improve the HTTP File Upload implementation
Fix a few resource leaks. Improve the API and add an integration
test. Also add compability layer for XEP-0363: HTTP File Upload 0.2.

SMACK-747
2017-03-10 17:54:29 +01:00
Florian Schmaus c81f28a3a2 Update Error Prone to 2.0.18
and update errorprone-plugin to 0.0.9.
2017-03-07 11:00:47 +01:00
Florian Schmaus 52a52e12d2 Make Body and Subject implement ExtensionElement 2017-03-07 08:53:31 +01:00
Florian Schmaus ca54f65b3e Merge branch '4.2' 2017-02-11 21:02:20 +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 ef0af66b21 Enfore spaces for indentation
Although I'm in the tabs camp, Smack uses mostly spaces. Therefore it
is the logical choice for the indentation style.
2017-02-07 22:10:10 +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 872b254db5 sendStanzaWithResponseCallback: Ensure exactly one callback is called 2017-01-30 21:01:56 +01:00
Florian Schmaus b142060f9e sendStanzaWithResponseCallback(): remove listener right away
I'm not sure why i've put the removeAsyncStanzaListener() call into
the finally block. If callback.processStanza(Stanza) takes a long
time (or even blocks), then it would appear to the "no response"
handling Runnable as if there was no response, when in fact there was
one.
2017-01-30 17:09:30 +01:00
Florian Schmaus 5d0dd49e61 Introduce ToMatchesFilter
and refactor the FromMatchesFilter into AbstractFromToMatchesFilter.
2017-01-29 11:08:16 +01:00
Florian Schmaus 51378aebee Revert "Throw exception if stanza child contains text"
This reverts commit eb9242768c.

Turns out, that there is in fact not such restriction in the
RFCs (only for <subject/>, <body/> and the a few others).
2017-01-24 22:47:16 +01:00
Florian Schmaus 62d903171f Remove NOP from FromMatchesFilter 2017-01-24 22:46:00 +01:00
Florian Schmaus 2ac0fc72ba Handle NameNotFoundException in smack-resolver-javax 2017-01-24 20:14:01 +01:00
Florian Schmaus 1bcb5a2d1a Also check that srvRecords is not empty 2017-01-24 20:13:40 +01:00
Florian Schmaus 9526926cd3 Log message about missing SRV RRs 2017-01-24 20:13:26 +01:00
Florian Schmaus af1bde4fd0 Make MUC invitations 'from' value an EntityJid
instead of an EntityFullJid, because according to XEP-0045 § 7.8.1.:

"The <room@service> itself MUST then add a 'from' address to the
<invite/> element whose value is the bare JID, full JID, or occupant
JID of the inviter …"
2017-01-20 17:06:06 +01:00
Florian Schmaus 4377e39b5f Add javadoc about client set resourceparts 2017-01-20 12:24:26 +01:00
Florian Schmaus 382ed9d871 Smack 4.2.0-rc2
-----BEGIN PGP SIGNATURE-----
 
 iQF8BAABCgBmBQJYe7kjXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
 ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ5Nzc1MDU5RjNBMjFEQ0UxNkJFNEZCQUUy
 MjM5QTdFOEY1ODUyMDUyAAoJECI5p+j1hSBSuGkH/1mU66MNR0/ywbdZ2RKcb9MK
 WTHBBOuD/KaqkQOQQ5Fud+ktyahmDd9Nk4TbchIJ56PlEPqJbhnwP8txh1gU+8Zz
 jpRHYYQiTEuLSblToVL3afrfd/IQnOrh7VbwkG7S1wkWmOFKCv94wlv/OgZFaICc
 RHHJyJbJ0TTuavEkJ141ruNYmq/qYjUjdLmFrqhT3hv3iuiHCT1PK1787wEB0EWS
 ciwkw2j/j/2i27XNQRwu7QaLsmUGk8rLnr2/AsYpmsBsjAMqMbNEQEPbIgO9MVef
 7dt/GWoqHjH1opVcOw+rRz/cynMii2sSTXiqRVTEZsWlx3uYYz5eKsuiuckZcBs=
 =yqh1
 -----END PGP SIGNATURE-----

Merge tag '4.2.0-rc2'

Smack 4.2.0-rc2
2017-01-15 20:02:13 +01:00
Florian Schmaus 7c46f58c80 Rename "PacketReplyTimeout" → "ReplyTimeout" 2017-01-12 20:57:19 +01:00
Florian Schmaus f31cc6e043 Fix IllegalArgumentException on DNS lookup if XMPP domain is wrong
Fixes the following exception thrown if the user had entered a non-existend XMPP domain:
java.lang.IllegalArgumentException: Must provide at least one InetAddress
     at org.jivesoftware.smack.util.dns.HostAddress.<init>(HostAddress.java:55)
     at org.jivesoftware.smack.util.dns.DNSResolver.lookupHostAddress(DNSResolver.java: 56)
     at org.jivesoftware.smack.util.DNSUtil.resolveDomain(DNSUtil.java:209)
     at org.jivesoftware.smack.util.DNSUtil.resolveXMPPServiceDomain(DNSUtil.java:136)
     at org.jivesoftware.smack.AbstractXMPPConnection.populateHostAddresses(AbstractXMP PConnection.java:626)
     at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPC onnection.java:556)
     at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection. java:888)
     at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.ja va:377)

Thanks to Grigory Fedorov for reporting.
2017-01-12 13:39:11 +01:00
Florian Schmaus d47463a533 Deprecate Chat API, introduce new Chat API
Also add (From|To)TypeFilter and update/fix the documentation in a few places.
2017-01-11 19:48:22 +01:00
Florian Schmaus b0fef6ffcb Ensure that populateHostAddressees() doesn't return a list with 'null'
Thanks to Grigory Fedorov for reporting this.
2017-01-09 19:36:21 +01:00
Florian Schmaus bfc14227ca Propagate stream errors on connect/login to the caller
Before this, if there was a stream error response by the server to our
stream open, that error response would only be handled in the reader
thread, and the user would get a message like:

"org.jivesoftware.smack.SmackException$NoResponseException: No
response received within reply timeout. Timeout was
5000ms (~5s). While waiting for SASL mechanisms stream feature from
server"

while the server may actually sent something like

<stream:stream
  xmlns='jabber:client'
  xmlns:stream='http://etherx.jabber.org/streams'
  id='6785787028201586334'
  from='jabbim.com'
  version='1.0'
  xml:lang='en'>
  <stream:error>
    <policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
	</policy-violation>
	<text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
	  Too many (2) failed authentications from this IP
      address (1xx.66.xx.xxx). The address will be unblocked at 04:24:00
      06.01.2017 UTC
    </text>
  </stream:error>
</stream:stream>

It was necessary to change saslFeatureReceived from SmackException to
XMPPException in order to return the StreamErrorException at this sync
point. But this change in return required the introduction of a
tlsHandled sync point for SmackException (which just acts as a wrapper
for the various exception types that could occurn when establishing
TLS). The tlsHandled sync point is marked successful even if no TLS
was established in case none was required and/or if not supported by
the server.
2017-01-07 10:38:41 +01:00
Florian Schmaus 24bbe63da1 Minor code improvements in DNSutil 2017-01-06 14:49:12 +01:00
Florian Schmaus 96aad6a4aa Add TODOs about when to remove deprecated methods 2017-01-04 16:00:53 +01:00
Florian Schmaus e9bbe9a475 Fix OOB exception when setHostAddress(InetAddress) is used.
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  at java.lang.String.charAt(String.java:658)
  at org.jivesoftware.smack.util.dns.HostAddress.<init>(HostAddress.java:48)
  at org.jivesoftware.smack.util.dns.HostAddress.<init>(HostAddress.java:62)
2017-01-04 15:35:47 +01:00
Florian Schmaus 90a5e289f8 s/processPacket/processStanza/ s/PacketCollector/StanzaCollector/ 2017-01-03 11:35:04 +01:00
Florian Schmaus 9328182912 Rework Bits of Binary implementation 2017-01-03 11:05:46 +01:00
Florian Schmaus 70e860fe27 Add SmackConfiguration.addDisabledSmackClasses(String...) 2017-01-03 11:00:05 +01:00
Florian Schmaus 183c605278 Bump JXMPP to 0.5.0 2017-01-02 09:40:46 +01:00
Florian Schmaus f633313c4a Add Message.setBody(CharSequence) 2017-01-02 00:47:25 +01:00
Florian Schmaus 3129165a1c Add ConnectionConfiguration.setHostAddress(InetAddress)
In previous Smack versions, it was possible to set the host's IP
address via setHost(String), this is no longer possible (since the
support for DNSSEC was introduced). The new
setHostAddress(InetAddress) allows it again to explicitly specifiy the
XMPP service's host IP.
2016-12-28 23:18:28 +01:00
Florian Schmaus ecf1ed7f6b Fix EntityCapsManager presenceSend
capturing all outoing presences of type 'available' would also capture
presences not used for presence broadcast, e.g., MUC presences.

This caused the EntityCaps integration test (localEntityCaps) to fail
if the MUC integration test was run before.
2016-12-23 23:52:29 +01:00
Florian Schmaus 8511a9e67b Fix deadline check
The pattern

if (now > deadline) break;
wait(deadline - now);

is insufficient in case "now == deadline" because the result would be
wait() being called with 0, which would mean "wait until
notified". Thus, the timeout would become infinite.
2016-12-19 16:29:16 +01:00
Florian Schmaus b558a128c3 Merge remote-tracking branch 'my/master' 2016-12-07 21:20:02 +01:00
Florian Schmaus 274e5630c4 Add support for XEP-0133: Service Administration
also extend Smack's integration test framework to use XEP-0133 as a
means for of throw away account creation.

Fixes SMACK-742
2016-12-04 21:42:50 +01:00
Florian Schmaus d976434bb3 Improve message of XMPPErrorException
by including the XMPP entity which send the XMPP error reply to us.

Also cleanup the no longer used constructors.
2016-11-29 16:40:08 +01:00
Florian Schmaus 9165e818d9 Add ParenPad and NoWhitespaceAfter checkstyle rules 2016-11-29 12:01:41 +01:00
Florian Schmaus 9d0d8088f4 Don't throw when calling UnparsedIQ.toXML()
this causes the debugger to terminate if an unparsed IQ is shown.
2016-11-24 10:38:19 +01:00