1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-04 23:55:58 +01:00
Commit graph

4438 commits

Author SHA1 Message Date
Florian Schmaus
89c5895ab3 Smack 4.4.0-beta2-SNAPSHOT 2020-08-07 22:06:32 +02:00
Florian Schmaus
b61426c8d0 Smack 4.4.0-beta1 2020-08-07 21:25:20 +02:00
Florian Schmaus
cf92566e26
Merge pull request #416 from Flowdalic/connected-boolean
Set 'connected' to 'true' as early as possible
2020-08-07 12:43:53 +02:00
Florian Schmaus
36d61d9e52
Merge pull request #413 from adiaholic/xep-0156
HttpLookupMethod: Position parser at START_ELEMENT before parsing
2020-08-07 12:37:04 +02:00
Aditya Borikar
7796b367cc Position parser at START_ELEMENT before parsing
This PR aims to provide parseXrdLinkReferencesFor() method the ability
to parse forward to the first START_ELEMENT tag.The HttpLookupMethodTest
tests the HttpLookupMethod class by parsing String. This makes use of
PacketParserUtils.getParserFor(String), which already does forward
winding to reach START_ELEMENT. However when fetching endpoints from a
remote host meta data, PacketParserUtils.getParserFor(InputStream) is
used which doesn't do winding in any form. And thus, even though
HttpLookupMethodTest tests pass, this implementation would crash while
parsing remote host-meta.
2020-08-07 15:01:53 +05:30
Florian Schmaus
e35175a3d5
Merge pull request #417 from Flowdalic/gradle-dynamic-versions
[build] Use ranged version [1.0.0, 1.0.999] for jXMPP and MiniDNS
2020-08-06 19:58:35 +02:00
Florian Schmaus
92ed777dba
Merge pull request #418 from Flowdalic/rename-waitForCondition
waitForCondition() → waitForConditionOrThrowConnectionException()
2020-08-06 19:58:22 +02:00
Florian Schmaus
ac788592a6 waitForCondition() → waitForConditionOrThrowConnectionException()
The method was already renamed, but not in
ModularXmppClientToServerConnectionInternal.
2020-08-06 18:17:04 +02:00
Florian Schmaus
1a2a613112 Set 'connected' to 'true' as early as possible
We previously only set 'connected' after connectInternal()
returned. This could lead to notifyConnectionError() ignoring stream
error exceptions, e.g. when establishing TLS which happens also in
connectInternal(), because 'connected' was still 'false'.

2020-08-06 13:08:06.265 19830-20423/org.atalk.android D/SMACK: SENT (0):
    <stream:stream xmlns='jabber:client' to='atalk.sytes.net' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
2020-08-06 13:08:06.333 19830-20424/org.atalk.android D/SMACK: RECV (0): ?xml version='1.0'?>
    <stream:stream id='16420577292739412012' version='1.0' xml:lang='en' xmlns:stream='http://etherx.jabber.org/streams' from='atalk.sytes.net' xmlns='jabber:client'>
    <stream:error>
      <policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
      <text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
        Too many (20) failed authentications from this IP address (::ffff:42.60.7.13). The address will be unblocked at 05:15:34 06.08.2020 UTC
      </text>
    </stream:error>
    </stream:stream>
2020-08-06 13:08:06.346 19830-20424/org.atalk.android I/aTalk: [241896] org.jivesoftware.smack.AbstractXMPPConnection.notifyConnectionError() Connection was already disconnected when attempting to handle org.jivesoftware.smack.XMPPException$StreamErrorException: policy-violation You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions
    <stream:error><policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xml:lang='en'>Too many (20) failed authentications from this IP address (::ffff:42.60.7.13). The address will be unblocked at 05:15:34 06.08.2020 UTC</text></stream:error>
    org.jivesoftware.smack.XMPPException$StreamErrorException: policy-violation You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions
    <stream:error><policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xml:lang='en'>Too many (20) failed authentications from this IP address (::ffff:42.60.7.13). The address will be unblocked at 05:15:34 06.08.2020 UTC</text></stream:error>
        at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:966)
        at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$700(XMPPTCPConnection.java:898)
        at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:921)
        at java.lang.Thread.run(Thread.java:919)

Which eventually leads to a NoResponseException

org.jivesoftware.smack.SmackException$NoResponseException: No response
received within reply timeout. Timeout was 30000ms (~30s). While
waiting for establishing TLS
[XMPPTCPConnection[not-authenticated] (4)]

We now set 'connected' to 'true' as soon as the transport (e.g. TCP,
BOSH, …) is connected. While this is in other ways also sensible, it
also allows notifyConnectionError() to handle exceptions in the early
connection stage.

Thanks to Eng Chong Meng for reporting this.
2020-08-06 16:32:26 +02:00
Florian Schmaus
3c54d5ffcd [build] Use ranged version [1.0.0, 1.0.999] for jXMPP and MiniDNS
This also means that we need to lookup the resovled versions of those
artifacts in order to provide the javadoc link.
2020-08-06 15:19:42 +02:00
Florian Schmaus
a356e91108
Merge pull request #415 from vanitasvitae/NEDEtypo
NoEndpointDiscoveredException: s/Not/No
2020-07-30 08:48:57 +02:00
dd631048a3
NoEndpointDiscoveredException: s/Not/No 2020-07-28 19:00:04 +02:00
Florian Schmaus
d34eda61fe
Merge pull request #414 from Flowdalic/state-string-precedence
StateDescriptor String-based precedence API
2020-07-27 17:13:49 +02:00
Florian Schmaus
ec80d5287b [core] Add String-based StateDescriptor precedence/inferiority declaration methods 2020-07-25 14:27:45 +02:00
Florian Schmaus
64fb47c98b Fix typo in StateDescriptor method: s/Inferiorty/Inferiority/ 2020-07-25 13:55:35 +02:00
Florian Schmaus
3003094130
Merge pull request #412 from Flowdalic/data-form-type-annotations
[xdata] Parse forms of any kind without field type annotations
2020-07-23 17:24:48 +02:00
Florian Schmaus
62b1320643
Merge pull request #410 from adiaholic/integrationTest
Add SimpleXmppConnectionIntegrationTest
2020-07-23 16:10:36 +02:00
Florian Schmaus
1bd097ed9b
Merge pull request #411 from Flowdalic/sasl
SASL / getFeature()
2020-07-23 16:09:57 +02:00
Florian Schmaus
103ffabc08 [xdata] Parse forms of any kind without field type annotations
We previously only looked in the registry for 'submit' type forms. But
also 'result' type forms may be send without field type
annotations. Same is true, but less likely, for 'form' type forms.
2020-07-23 15:47:17 +02:00
Florian Schmaus
329948b442 Add XMPP.(get|has)Feature(Class|QName) and deprecate (String, String) 2020-07-23 14:32:14 +02:00
Florian Schmaus
cbdde0f541
Merge pull request #358 from vanitasvitae/sce
XEP-0420: Stanza Content Encryption
2020-07-23 14:27:08 +02:00
Florian Schmaus
f1e10bc6bc
Merge pull request #409 from vanitasvitae/connectionListenerConnecting
ConnectionListener: Add connecting(XMPPConnection) method.
2020-07-23 14:19:14 +02:00
78f37a909e
Add support for XEP-0420: Stanza Content Encryption 2020-07-23 11:02:28 +02:00
Aditya Borikar
fcaeca48ec Add SimpleXmppConnectionIntegrationTest 2020-07-22 16:35:56 +05:30
Florian Schmaus
bcfe7b12a4 [tcp] Mark SM as disabled prior resource binding
Otherwise we may send a SM ack request with the bind IQ request,
causing a stream error:

D/SMACK: SENT (0):
    <iq id='SETVB-74' type='set'>
      <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
      </bind>
    </iq>
    <r xmlns='urn:xmpp:sm:3'/>
D/SMACK: RECV (0):
    <iq id='SETVB-74' type='result'>
      <bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
        <jid>
          snakeman@wiuwiu.de/eHeTGlCq
        </jid>
      </bind>
    </iq>
    <stream:error>
      <unsupported-stanza-type xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
    </stream:error>
    </stream:stream>
2020-07-20 14:26:06 +02:00
Florian Schmaus
2edf27f5da
Merge pull request #406 from vanitasvitae/oxSecretKeyBackupRestore
OX: Improvements to Secret key backup restore function
2020-07-18 22:40:20 +02:00
Florian Schmaus
dad2a1ad2e Bump MiniDNS version to 1.0.0 2020-07-18 21:55:56 +02:00
Florian Schmaus
7d6374b04b Bump jXMPP version to 1.0.0 2020-07-18 21:55:47 +02:00
Florian Schmaus
2b423b911e Merge branch 'master' of github.com:igniterealtime/Smack 2020-07-18 21:47:06 +02:00
2f98bb25e2 OX: Fix incorrect documentation URL 2020-07-18 15:18:37 +02:00
15b8a81493 OX: Trust secret key upon backup import 2020-07-18 15:18:29 +02:00
Florian Schmaus
81cccaab91
Merge pull request #408 from vanitasvitae/secretKeyBackupPassword
Allow user-supplied secret key backup passphrases
2020-07-18 14:48:53 +02:00
Florian Schmaus
037bf3a27c
Merge pull request #407 from vanitasvitae/oxDeadCode
OX-IM: Remove redundant code to add self to recipients
2020-07-18 14:46:35 +02:00
bc599a6dd6
Add callback method for when Smack is connecting 2020-07-18 12:50:08 +02:00
6e57ea0873
Allow user-supplied secret key backup passphrases
Instead of passing the passphrase back to the user via a
DisplayBackupCodeCallback, we directly return the passphrase
which is now represented by a class.

Also we now allow the user to provide the passphrase.
2020-07-15 22:22:42 +02:00
075e65ad40
Fix indentation 2020-07-15 22:20:50 +02:00
bb3c491e0c
StringUtils: Fix typo and expose unambiguous alphabet as string 2020-07-15 22:15:38 +02:00
a587827ef8
Remove unnecessary lines from OX backup restore routine 2020-07-15 18:08:18 +02:00
Florian Schmaus
d3a99a133a [core] Fix log/exception message of XmppElementUtil
The Class.toString() already prefixes the resulting string with "class
", no need to state it explicitly in the log message that this is a
class.
2020-07-13 08:50:10 +02:00
9fd2c6f9ec
OX-IM: Remove redundant code to add self to recipients 2020-07-12 15:47:06 +02:00
Florian Schmaus
b7fe56fb9b [xdata] Add message to IllegalArgumentException 2020-07-06 11:51:12 +02:00
Florian Schmaus
3e8666cd91 [xdata] Fix case in FillableForm 2020-07-06 11:51:12 +02:00
Florian Schmaus
89e39fadd2
Merge pull request #403 from adiaholic/bugFix
Remove unrequired assignment of value to connectionEndpoint variable
2020-07-06 11:31:26 +02:00
Florian Schmaus
b1c0f3fa26 Merge branch 'master' of github.com:igniterealtime/Smack 2020-07-06 11:22:27 +02:00
Florian Schmaus
c80afbbce7
Merge pull request #404 from Flowdalic/ibb-manager-fix
[ibb] Ensure InBandBytestreamManager is a singleton
2020-07-06 11:21:00 +02:00
Florian Schmaus
ed02bcf0d4 [ibb] Ensure InBandBytestreamManager is a singleton
InBandBytestreamManager followed an unusual pattern: Within the
connectionTermianted() callback, it would remove itself from the
'managers' map. This allowed for multiple instances of an
InBandBytestreamManager to exist for the same connection, causing all
kinds of issues.

This fixes the issue by changing InBandBytestreamManager to use the
Smack-idiomatic pattern used by managers.

We also do no longer reset the listeners if the connection is
termianted, as listeners (and handlers) typically persist until they
are explicitly removed by the user.

As positive side-effect, the number of indeterministic unit-tests,
caused by using Thread.sleep(), is reduced. The executor service in
InitiationListener was also removed, because the IQ handler is already
called asynchronously to the connections main loop.

Thanks to Anno van Vliet for reporting this.
2020-07-03 22:01:15 +02:00
Florian Schmaus
049d687778 [gradle] Add fix for javadoc search 2020-07-03 22:01:06 +02:00
00acdfcb9e
Add QName field in OriginIdElement 2020-07-03 00:24:05 +02: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
Aditya Borikar
45f75d5ce0 Remove unrequired assignment of value to connectionEndpoint variable
The current code would work just fine for a connection having
multiple endpoints. However, when there is only one endpoint
ConnectionAttemptState.nextAddress() would return null, since
connectionEndpointIterator has already iterated over the only
possible value in the contructor leading to a NullPointerException.
This means that during establishment of a connection having multiple
endpoints, the first value inside connectionEndpointIterator would
always be overlooked.
2020-07-02 01:59:58 +05:30