summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-02-02Add support for extracting certificate chain from PEM stringTobias Markmann
Add PrivateKey class to simply encapsulate arbitrary private key data and the corresponding password. This enables easy unit testing by loading the certificate and key from within a test case. Test-Information: Added unit tests for certificate and key generated by OpenSSL. Tested on macOS 10.13.2 with OpenSSL. Change-Id: I1c9ffc3c70f61af65c4f1c48670badaf74b672b7
2018-01-30Modernize OpenSSL crypto backendTobias Markmann
* use std::unique_ptr for memory management of dynamic OpenSSL objects * use an initializer class and static instance of it to correctly initialize/finalize OpenSSL on first use * use enum class instead of simple enum for state * use nullptr instead of NULL Test-Information: Builds and tests pass on macOS 10.13.2 with clang-trunk and ASAN. Change-Id: I346f14e21c34871c1900a8e1ac000450770a0bbe
2018-01-09Avoid crash with Connector failure race conditionKevin Smith
We were seeing crashes on macOS on a slept laptop overnight, very rarely. The backtraces pointed to accessing a deleted currentConnection in Connector. Eyeballing the code for a path that could trigger this, if the timer fires onTick, queing on the eventloop, and before that event is processed the connection queues onConnectFinished in the event loop, currentConnection will be reset by the timeout tick handling, and will then boom when the handleConnectionConnectFinished is called for onConnectFinished. Test-Information: Eyeballs Change-Id: Iaf4af1450ca8ee13761a33c0dc75f0311d2291b2
2018-01-09Add an log assertion to ConnectorsThanos Doukoudakis
This will check that the connection object is valid when a connector timeouts, and if not log it. Test-Information: None Change-Id: I0af3e88fe1f527c25c4bb6c886668d19167b489b
2017-12-19Allow to override Swiften libdirDennis Schridde
The libdir for Swiften was hardcoded to "lib". With this patch it is possible to override it. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Build with SWIFTEN_LIBDIR=lib64 and observe that files are installed into the desired directory (i.e. /usr/lib64, if SWIFTEN_INSTALLDIR=/usr). Change-Id: I4d844b93a189254b5923f9cd58190b0f6a65b9ac
2017-10-13Don't require servers to advertise an SSO domainKevin Smith
This doesn't change the behaviour where domain is advertised, but does mean that SSO can be attempted where the hostname isn't advertised, where previously it would be refused. Test-Information: Light testing (not by me) against M-Link not advertising hostname. I think this is sufficient, given this is an experimental feature, hidden behind a config flag, and this only extends behaviour, rather than changing previously supported paths. (The tested version was with a ternary instead of value_or) Change-Id: I381fe23ab152486b195acff5858bf0a705b86b59
2017-10-02Fix Code According to New clang warning (-Wobjc-messaging-id)Tobias Markmann
Test-Information: Builds and test pass on macOS 10.13 with clang-trunk. Change-Id: I7a515a003602a983681f85374a8a77dc953f533d
2017-08-15Improve Swift’s interactions with Smart CardsThanos Doukoudakis
This patch improves logging and refactors SchannelContext and CAPICertificate classes, to improve logging and how Swift interacts with smart cards. Test-Information: Tested on Windows 10 (Qt 5.7) Change-Id: Ic4d306beafb9e5d253731769f222e6949995d5e7
2017-08-08Enable log information export to a fileThanos Doukoudakis
This patch introduces the “logfile” argument to the client, which can be used to specify a file path for a log file, where all logging information will be stored. Test-Information: Tested on windows 10 and Ubuntu 17.04 Change-Id: I6a2f14585a72f25e7e78d79cb633e1ddc4d43c3b
2017-07-24Add Channel Join and Leave Capability to MIXTarun Gupta
Add UpdateSubscription feature for subscribing to additional MIX nodes Add Joining a channel with a preference form Add requesting user preference form and updating the preferences License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tests added for joining and leaving a channel as in XEP-0369, which passes. Tests also added for updating subscription, joining channel with preference form and requesting user preference form as in XEP-0369, which passes. Tested on Ubuntu 16.04 LTS. Change-Id: Ibc2737f6154eeee1a85e98cb5f80c8bdbad35dcd
2017-07-18Add MIXUpdateSubscription Element, its Parser and SerializerTarun Gupta
Updates MIXJoin Element list of subscriptions to an unordered_set. Remove redundant MIXSubscribe Element. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added tests for MIXUpdateSubscription Parser and Serializer based on examples in XEP 0369, which passes. Tested on Ubuntu 16.04 LTS. Change-Id: Ied06269cf329b4fdffdde4ace67ebffa4089fbde
2017-07-14Add MIXRegisterNick Element, its Parser and SerializerTarun Gupta
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added tests for MIXRegisterNick Parser and Serializer based on examples in XEP 0369, which passes. Tested on Ubuntu 16.04 LTS. Change-Id: I80796db9d540c58296afa3454f29e1fb81d04615
2017-07-13Fix LRUCache documentationTobias Markmann
Doxygen raised warnings for referencing unknown classes and template variables it cannot deal with. Adjusted the comment to just format them instead of referencing. Test-Information: Ran ./scons doc=1 and verified that doxygen did not raise warnings anymore. Change-Id: I8927195457bbaf92066591f24e536e9b48a04808
2017-07-13Remove Swiften/Base/Override.hTobias Markmann
Replaced SWIFTEN_OVERRIDE with C++11 standard override keyword. Test-Information: Tested on macOS 10.12.5 with clang trunk. Change-Id: If89c6cc2a648662522a320834c314496c943a55a
2017-07-12Add MIXSetNick Element, its Parser and SerializerTarun Gupta
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added tests for MIXSetNick Parser and Serializer based on examples in XEP 0369, which passes. Tested on Ubuntu 16.04 LTS. Change-Id: I23081637f2aecf9fc5abc63147d01bfd4d2bb2f1
2017-07-11Add missing SWIFTEN_OVERRIDE statements to dtorsTobias Markmann
Also removes -Winconsistent-missing-destructor-override from the list of ignored clang warnings. Test-Information: Tested on macOS 10.12.5 with clang trunk. Change-Id: Iad951879e01eb951a2a393399f55e4e37437c6a2
2017-07-11Add MIXPayload, its Parser and SerializerTarun Gupta
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added tests for MIXPayload Parser and Serializer based on examples in XEP 0369, which passes. Tested on Ubuntu 16.04 LTS. Change-Id: I45da05d6fe57b4be7ed8534dd84cbf0fd31ced1a
2017-07-07Make std:: make_unique available in gcc with c++11Joanna Hulboj
Test-Information: Unit tests pass OK on Windows 10 and CentOS 7.3. Change-Id: I33c9eb6b3e6409727350a44e6d5c88c5e8907275
2017-07-07Add support for authorization identity in SASL EXTERNALAlexey Melnikov
As per RFC 4422. Tested by connecting Harrier configured to use SASL EXTERNAL to M-Box and verifying that authentication worked as expected. Also added cppunit test for SASL EXTERNAL. Change-Id: Ica5c72a858b9d8fcd9197f9c4287ca84e03fcbd2
2017-07-07Update namespace for MIX ElementsTarun Gupta
Namespace update from urn:xmpp:mix:1 to urn:xmpp:mix:0 for MIX elements for checking against server implementation License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Change-Id: I1bbd06d83f54fcde81ae0ed06dda90aec0ef1aeb
2017-07-06Adds MIXLeave Element, its Parser and Serializerswift-5.0alphaTarun Gupta
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added tests for MIXLeave Parser and Serializer based on examples in XEP 0369, which passes. Tested on Ubuntu 16.04 LTS. Change-Id: Ie9eb3341b23099de4dda2b9915d28115dbfe5837
2017-07-05Adds MIXUserPreference Element, its Parser and SerializerTarun Gupta
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added tests for MIXUserPreference Parser and Serializer based on examples in XEP 0369, which passes. Change-Id: I06595325f4cc2b34d5ab5a93a6caa00330fe0737
2017-07-03Adds MIX Create Element, its Parser and SerializerTarun Gupta
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added tests for MIX Create Parser and Serializer based on examples in XEP 0369, which passes. Change-Id: I33b85c8243d55cd293c886f2607bdd9dec6c7bdb
2017-06-26Adds MIX Join Element, its Parser and Serializer.Tarun Gupta
Add MIXDestroySerializer to FullPayloadSerializerCollection. License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added tests for MIX Join Parser and Serializer based on examples in XEP 0369, which passes. Tested on Ubuntu 16.04 LTS. Change-Id: Ibf7446dd65714dccdd39c485549fd9fb9faba40c
2017-06-26Fix FileWriteBytestreamTest under WindowsVitaly Takmazov
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Fixes FileWriteBytestreamTest by closing WriteStream before file deletion which passes. Tests performed under Windows 10 1703 Change-Id: I0be891af652138af23f8db9e5526d927d39c9856
2017-06-26Fix compiler warnings raise by Clang on LinuxTobias Markmann
Clang raises warnings about unused members and macros on Linux. These are fixed with this change. Test-Information: Tested with clang-3.9 on Debian Stretch. Change-Id: I87bc0606cfd14365330aaad4ed433d3bca2d5330
2017-06-26Remove unneeded forward declarations from Swiften headersTobias Markmann
Found by cppclean. Test-Information: Still builds on macOS 10.12.5 with clang trunk. Change-Id: Ie8a154e12b196587c956c8b333abf529a36f6bb3
2017-06-25Adds MIX Destroy Element, its Parser and Serializer.Tarun Gupta
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Added tests for MIX Destroy Parser and Serializer based on examples in XEP 0369, which passes. Change-Id: I56810eb2fc26cc6aeb5e1cfb2a32e312f0607ba9
2017-06-22Add missing SWIFTEN_API declarationsVitaly Takmazov
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Tested performed under Windows 10 1703 Change-Id: I332923986c8d62b75a76ef9f784811d09a662f22
2017-06-22Handle badly-formed labels catalogueThanos Doukoudakis
Updated the code to ignore labels that belong to a catalog item that is malformed and not added as a valid item. Test-Information: Added unit tests for badly formed catalog items and labels. Tested on Windows 10 (Qt 5.7.1) and Ubuntu 16.04 (Qt 5.5.1) Change-Id: I11fbd3b54faa3ee225a08a87ad8ed59977b7ff20
2017-06-22Add missing SWIFTEN_API annotationTobias Markmann
Test-Information: None. Change-Id: I1d8e0af76841824ff573bd19f664a04e4f2d97a1
2017-06-21Add Coala config for whitespace checkingTobias Markmann
Coala ( https://coala.io/ ), is a meta linting tool, that comes with own checks and integration for external tools for a lot languages. This adds a configuration that enforces no trailing whitespace and no lines with only whitespaces. Test-Information: Ran coala and fixes the issues it raised. Change-Id: I30b201135bbe8888d9d1bcadb28f9ced9b5db28f
2017-06-21Fix compiler warningsKevin Smith
Both catching polymorphic base classes by value and explicitly moving things preventing return value optimization. Test-Information: Compiles on macOS with latest xcode with allow_warnings=False and unit tests pass Change-Id: Ibdc67f4f2019f85f14635df2a3ff06bddbb8e2b6
2017-06-19Don't crash when SSL_new failsAlexey Melnikov
NULL pointer dereference was happening in OpenSSL code (inside SSL_set_bio) when SSL_new returned NULL due to lack of Isode HGE license. Change-Id: Iebd78be7eb6c7978de0bff225915dc393a516f08
2017-06-18Adds MIX Participant Element, its Parsers and Serializers.Tarun Gupta
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Adds tests for MIX Participant Parser and Serializer from XEP-0369, which passes. Tested on Ubuntu 16.04 LTS. Change-Id: Iee2d96c8ebdf9461c28518f8f8c28c11d2a94524
2017-05-22Close changelog for Swift 4.0 RC2swift-4.0rc2Tobias Markmann
Test-Information: None. Change-Id: Iddc3e6c57ff19cd12177d6d1513949fc49d05eab
2017-05-15Add pointer checks in some CoreClient members.Thanos Doukoudakis
This patch adds some checks in the CoreClient class to avoid accessing stanza and session channels to send data when they are not available. The Sluift lua wrapper functions will throw an exception in these cases. Test-Information All unit test pass. Timlx: Test Suite ‘basic’: All tests Pass. Test Suite ‘fmuc’: All tests except FmucChain Pass (Not related with the changes) Change-Id: I3d5894b3cfdafd0ea28c0fb33b6db8588f2a5c8f
2017-05-05Fix SendFile example heap-use-after-freeThanos Doukoudakis
This fixes the crash by moving Swift::Client to a unique_ptr. By specifying the order the objects will be destructed, we avoid accessing the Socks5ByteStreamProxiesManager instance after it has been destroyed. Also there is no need reset the outgoingFileTransfer pointer. Test Information: Use the SendFile example to send a file to a user connected with Swift. Change-Id: I0462dc60c1d4d5eb3b07516c6e609bbe70954039
2017-05-04Fix recent chat entries being incorrectly displayedJoanna Hulboj
Recent chat entries were displayed as a randomly generated numbers instead of impromptus (if invitees were offline). Title displayed in the Recent Chat List for MUC is now based on both the occupants and invitees. To do that a collection with all the invitees is being stored (new) along the occupants (existing). Test-Information: From Swift menu choose Actions, Start Chat... Add some offline contacts to the List of Participants and press Finish. Recent chat entry will have correct name (combined of contact names). Change-Id: Ie076165e8dbb493aa261cc49ca3ab1e0c1c542a8
2017-04-21Bring Swift and Swiften ChangeLog.md files up to dateTobias Markmann
Test-Information: None. Change-Id: I5efd775af454af50c9ae46a1b2208c7ebdea2824
2017-04-18Support Last Message Correction in multi client scenariosTobias Markmann
Previously Last Message Correction edits are only applied if they came from the same resource. This makes sense in MUC scenarios but does not in 1-to-1 chats. This changes the Last Message Correction behaviour for MUC and 1-to-1 chats so that different clients from the same bare JID can edit each others messages. Test-Information: Added unit test to verify Last Message Corrections work as expected when coming from the same client and from different clients. Manually verified that the receiving client correctly shows a corrected message if the sending client reconnected between first message and edit. All unit tests pass on OS X 10.11.6 with Qt 5.5.1. Change-Id: If533ecc7032e59e324979c577726f2da739012e6
2017-04-11Simplify algorithm for concatenating using modern c++Joanna Hulboj
Test-Information: Unit tests pass OK. Change-Id: I6328dd55482ed8058ec8510a873fdd64ff978c72
2017-04-06Reset the chat state to active after a few secondsThanos Doukoudakis
Fix for swift-217 When a user sends a composing Chat State Notification a timer will start. If the user doesn't send or cancel the message before the timer expires, an active CSN will be sent. Test Info: Build on Windows and unit test pass. Tested the new functionality with Windows and Linux Client. Added some test cases to cover the scenario that user goes idle while a CSN composing state has been sent. Updated ChatStateNotifierTest to use gtest. Updated ChatsManagerTest to use a valid TimerFactory object instead of nullptr. Change-Id: I35201947e4f042805a6d9df1340a0335effcd657
2017-04-04Add missing check for initialised pointerTobias Markmann
Coverity raised this issue. Test-Information: All unit and integration tests, including the file-transfer tests, passed on macOS 10.12.4. Change-Id: I418358366478ad76e4eff4fb0a3559373931e111
2017-04-04Verify certificates for HTTPS BOSH connectionsTobias Markmann
Test-Information: Tested against a BOSH server with a valid HTTPS certificate and against a BOSH server with an expired HTTPS certificate. Tested on macOS 10.12.3 with Qt 5.5.1. Change-Id: I9989389b271961fc4d66db56198b32715af52ae7
2017-03-31Use std::random instead of boost::randomJoanna Hulboj
Test-Infotmation: Unit tests pass OK. Change-Id: I1b6d3711d97daa86cccbb44aecb1b4025f2fcc8a
2017-03-28Modified XMLBeautifier to handle split payloadsJoanna Hulboj
When receiving network data we were processing it in chunks. Sometimes one XML message got split across multiple chunks. XMLBeautifier was stateless and would create a new parser for every single chunk. This was causing multi-chunk messages to be truncated in the beautified output. The change I made in XMLBeautifier allows it to maintain the state. Test-Information: Tested unger Windows 10 and CentOS. Unit tests pass OK. Change-Id: Idad2a8e0248ed3cbe2b47a12718b909e56ac1279
2017-03-23Add Client State Indication Element, its Parser and SerializerTarun Gupta
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details. Test-Information: Adds tests for Client State Parser and Serializer, which passes. Tests performed on Ubuntu 16.04 LTS. Change-Id: I60c63f63e1c0fdd55600ef42faa95989ca5ab75b
2017-03-15Do no emit onXMPPDataRead when the session is terminatedTobias Markmann
On a bosh error BOSHSessionStream, posts an event to the event loop that closes the XMPP stream. If onXMPPDataRead is emitted, that data is handled before the close of the stream though, which can cause another BOSH request to be sent. Test-Information: Added a unit test verifying the behaviour. Wrote a custom python script replicating the original error and verified that Swift does not stay connected on a BOSH error with additional text data. Tested on macOS 10.12.3 with recent clang trunk. Change-Id: Ie90099afa0934707a6758b00706a65227ceb48b8
2017-03-13Add LogSerializer for BOSHErrorTobias Markmann
Test-Information: Tested and used it during a recent debugging session on macOS 10.12.3 with recent clang. Change-Id: Ia4883a69a94f962006a39b294d6b9b67e0990541