Commit Graph

15067 Commits

Author SHA1 Message Date
17d89dfd8b fuzzing/utils: Add utilities taken from UT
Change-Id: I53c9da27babcbb1c1f678ddf7b885a322d3a4d96
2021-06-25 11:51:27 -04:00
e5623694cf fuzzing: Add actors and dring-sample
Change-Id: Ia946d08f370143ff2e7d9ece379ad63a8207a4b3
2021-06-25 11:51:27 -04:00
91adbe56f2 fuzzing/common: Common definitions
Change-Id: I5a3718b9c19800bd6615b52a050f6f443394136e
2021-06-25 11:51:27 -04:00
c9757b595d auto-tools: Add fuzzing directory
Change-Id: I189cdf06e74314f6e35b34addafe599d39f2dc42
2021-06-25 11:51:20 -04:00
b3a1f4263f multiplexed_socket: protect buffer before moving
Change-Id: Ibb9d0b2d0ab638de914d31c500e41224cf293f1e
2021-06-25 09:52:02 -04:00
5fb5de1a91 conference: fix audio only participant
with lasts ms patches, audio only participants dummy video was not being attached to conference mixer, causing participant to not show

Change-Id: I4621562e901aec7dfed6c6ae4a543724f9ccb0d3
GitLab: #565
2021-06-23 14:47:02 -04:00
93a34c9ab4 notify_one: cleanup
Change-Id: I26433e1463ecb261fb586431b6c43a3e6b931dcf
2021-06-23 10:27:32 -04:00
e5d95eb6d4 test: fix testMemberJoinsNoBadFile by waiting for join before copying
Change-Id: I4e34411c6e362c2aca31337224b077f7674d73da
2021-06-22 16:28:11 -04:00
2afa99fd12 daemon: Install dring to libexec and edit templates at install time.
Executables are typically installed under bin/, sbin/ or libexec,
rather than lib/.  The problem was noticed when trying to use Jami
with a Guix relocatable pack, which only wraps executables found under
the above locations.  Since dring is a daemon and should not be run
directly by users under normal circumstances, the convention is to use
the libexec directory, according to the File Hierchy Standard 3.0.

Also tackled in this change is the substitution of the Autoconf
variables at installation time rather than configuration time, as per
the GNU Coding Standards.  The following solution is taken from
https://github.com/gentoo/eudev/pull/183/commits, which in turn is
adapted from the Autoconf manual (c.f.: info "(autoconf)Installation
Directory Variables").

* bin/Makefile.am (ringlibdir): Delete variable.
* bin/dbus/Makefile.am (do_subst): New variable.
(cx.ring.Ring.service): Derive from the cx.ring.Ring.service.in
template.
[HAVE_WIN32]: (ringlib_PROGRAMS): Rename to ...
(bin_PROGRAMS): ... this.
[HAVE_OSX, RING_DBUS]: Likewise.
* bin/dbus/cx.ring.Ring.service.in (Exec): Adust.
* globals.mk (ringlibdir): Delete variable.
* configure.ac [with_dbus] <AC_CONFIG_FILES>: Remove
bin/dbus/cx.ring.Ring.service.  Also remove the LIBDIR variable, no
longer used.  Fix indentation.

Thanks to Vladimir Stoiakin for providing feedback on this change.

Change-Id: I845bf2bd590a9457e70ca173027217b8f164d713
2021-06-22 15:32:29 -04:00
4bb6741ee3 datatransfer: save directly to conversation_data if no path is set
Incoming transfers should be preserved in the conversation's data
directory by default. This will prevent broken pending file
transfers and chat UI when the user cleans their download folders.
Subsequent commits to the project should provide a mechanism for
users to download(copy) transfers to their chosen download path.

Change-Id: Ide109fadb950ce7ab096c052c0a54ad4d215a9a1
2021-06-22 13:02:24 -04:00
dd36baa517 fileutils: remove symlink creation on windows
Requires developer mode at best on windows 10

Change-Id: I0861c3f87c51f0de9de3f3860b371ced0d5ccb2d
2021-06-22 12:54:30 -04:00
eaeb865a33 ut_syncHistory: fix testCreateConversationWithMessagesThenAddDevice
sendMessage is async, causing messages to be mixed before the assert

Change-Id: Ia08855a6a1516db2ee5acf01c166055831be80eb
2021-06-22 12:20:25 -04:00
d8545316f8 jamiaccount: check if conversation is valid before getting infos
Also check repo pointer in conversationRepository. If the conversation
is not correctly cloned (can be caused by a lot of things during the clone),
the infos will be invalid, so avoid to crash in this case.

Change-Id: I42a15200a06ca700bac972deea4cfc07ae87cae8
GitLab: #568
2021-06-22 09:59:22 -04:00
8ecbfcbe31 jamiaccount: check sip_tr before using it
If the ICE is closed during the cacheSIPConnection, the sip transport
will not be found causing a potential crash

Change-Id: Ic2e7ab9272a2eb3274256151e37c2acd208cb0dd
GitLab: #569
2021-06-22 09:43:49 -04:00
aca5de93b0 conversations: prevent segfault when git repo can't be opened
Change-Id: Iff94a21f26fd1518e1d7287e511c41176ea8eea9
2021-06-17 17:34:29 -04:00
d769d33840 ice: fix logging of ICE components
Change-Id: I610ae85bb3b779457a9ce64161e3b8b19ca820df
Gitlab: #516
2021-06-17 13:20:52 -04:00
3ed5f067e7 sip/sdp: fix media direction in hold/resume
Media direction attribute in the SDP should be set to "sendonly"
when the call is put on-hold.

Gitlab: #553

Change-Id: Iad82bf1fcac703bd275e857f28d1a4aa7323cc0d
2021-06-17 09:21:44 -04:00
64c77aeb35 jni: add hangupParticipant
Change-Id: I829ca79f3786d400c1cf9937affcd713ea48e05e
2021-06-16 18:44:55 -04:00
67af5b1394 logger: removed windows-specific monitoring
Change-Id: I3c0202705488c84cade375b79a9d47669c2dcd20
2021-06-16 11:18:26 -04:00
9a7dc45818 multiplexed_socket: Catch msgpack::type_error
Catching a generic exception could hide problems deeper in the call stack.

Found-by: fuzz-msgpack

Change-Id: I93e1f92aca6e3cff259d52cdedfd83996994b721
2021-06-16 10:35:27 -04:00
35d4ffc9c1 autotools: fix dependency declaration
Change-Id: Ib1eb25f11fccd51424012bb11d5e8586fcc8e575
2021-06-15 14:34:34 -04:00
cb5b3bd29d jamiaccount: do not crash on a failing mode()
Change-Id: I69bf2a2b2a8c7fed6d38c1b85ab9d8069442b4d1
2021-06-14 19:53:11 -04:00
d6278283f8 swarm: improve syncing and fix sync after import
Because no more devices can exists after an import, the swarm MUST be able to
sync from known conversation's members.

Change-Id: Ic22ec813b303815ce62b45fea6ab317ab3ba3147
2021-06-14 19:53:10 -04:00
fabfd06e73 conversationrepository: fix signal emission
Change-Id: Icb8b13668a749c27125f0377299cf96a51170132
2021-06-14 16:31:12 -04:00
8044cab4f7 unitTest: fix fileTransfer, syncHistory
Change-Id: I087ee6e3e0e8f1530272a28f6f940571d542ebc4
2021-06-14 15:45:41 -04:00
348ade9e2a multistream: fix compil and logic (ut_call, ut_conference, ut_media_negotiation)
Change-Id: Ia7ed4438ccd466ec0bab60b5a85d9b67f721d0d8
2021-06-11 16:35:06 -04:00
8a753f0463 swarm: only request a connection when peer is detected if a sync is needed
fetched check the devices who has fetched since the last commit. With this file
we can detect if a device needs to fetch and if it's the case we start a connection.
cacheSipConnection will sync the conversations when called. This avoids the
daemon to connect too all contacts

Change-Id: Id85db09c3c0a6aa44dd48b3bbee5ed7e0a5d6b84
2021-06-11 15:26:01 -04:00
a21f1d8ce9 tls_session: stop handshake on interrupted due to a shutdown
Change-Id: I4deaafb9b8c6f3df675049c7c3a95f7924983503
2021-06-11 15:26:01 -04:00
f48e9693e4 datatransfer: fix jni
Change-Id: I505a82849bcd3f33fe772f75b58e50507601c920
2021-06-11 15:26:01 -04:00
638fb15ab9 jamiaccount: retrigger onPeerOnline on main thread
this avoid to lock configurationMtx in a dht thread (this will block the
shutdown).

Change-Id: Ie04a7a34ccd85a3c05214a373a7b7cca4350ad7b
2021-06-11 15:26:01 -04:00
7ca65af186 swarm: send conversationId in trust request confirm to enable swarm
Change-Id: I20add73ed92aece44687bf133914883547dd2f32
2021-06-11 15:26:00 -04:00
f9d8363d5a jamiaccount: sync, use msgpack instead of big json and add DeviceSync
Change-Id: Ib242760919521113c4d76beb14b37311bfba17d4
2021-06-11 15:26:00 -04:00
0f49be34ff jamiaccount: compat: be able to add a contact if the trust request is not found
Change-Id: Ic336fd64f666debf3e1183fb705af65f82a4bdb7
2021-06-11 15:26:00 -04:00
14f286bab8 datatransfer: implement downloadFile logic
Add mechanism to re-ask for transfers and sendProfile
with new logic

GitLab: #524
Change-Id: I9f10328ff0e2bd9128e2d7d1afd7fa272dd14cdf
2021-06-11 15:26:00 -04:00
a5d3fc936e jamiaccount: re-enable sync
Change-Id: I142e017e290c643a73f2b2b422533ec8d7cc0483
2021-06-11 15:26:00 -04:00
612f7f6b41 data-transfer: re-ask for transfer
add API to ask for a failed transfer. This can be used when the
client detects a transfer they doesn't have yet. It will ask all
members of the conversation to send the transfer back.

GitLab: #136
Change-Id: I1484298c4fa0eabb614132e22d8032612e14b949
2021-06-11 15:26:00 -04:00
e6bd5d7383 swarm: fallback to old conversation even if trust request confirm is missed
Sometimes a non swarm can send a text message via the DHT but not the trust
request confirm. In this case, the discussion must use the old path.

Change-Id: Id0d5223c830abe0840bef167b4be50abc276a72c
2021-06-11 15:26:00 -04:00
59ece88f9a contact_list: link conversationId to contact
Change-Id: Ib8fcbbb95a4df84e297ad468b8b4b239a172a153
2021-06-11 15:26:00 -04:00
2438254a51 plugins: attach swarm and Plugins System
Change-Id: I136f5ba49f14a379ec6dce37fbd837e38d90f549
2021-06-11 15:26:00 -04:00
d475a227fb swarm: clean APIs
Pass all methods in async and on the io pool if they write into
the repository. Moreover, now MessageReceived guarantees to be
ordered if announced. e.g. if a parrallel merge and commit are done
previously if the merge was done before the commit you could receives
MessageReceived(merge) after MessageReceived(commit). Now it's
impossible. So the linearizedParent is guaranteed to be announced
before.

Change-Id: If4b94f19f5bf5abd4841fc19074231e3411e077d
2021-06-11 15:26:00 -04:00
c216e3e8fa swarm: remove conversation for non-compatible contacts
If a TrustRequest is confirmed without conversationId this means
that the contact don't support swarm. So, we can drop the
conversation and fallback on old path.

Change-Id: Ic8238312fe79e10f340460d20880dbfc8dccf3f7
2021-06-11 15:26:00 -04:00
030983a5f5 swarm: relink filetransfer
Change-Id: Ia80930bdec6b5e125fd559fcd6b125a45b4eba0c
2021-06-11 15:26:00 -04:00
427e6b3ab3 swarm: relink setMessageDisplayed
Change-Id: Ic1e002a1e8edf79c5c392e707dd857c7e88667ec
GitLab: #319
2021-06-11 15:26:00 -04:00
a1b04c7213 swarm: relink setIsComposing for swarm support
GitLab: #320
Change-Id: I82b049cfa83f1e3e38a106bce142c1e7ce31557c
2021-06-11 15:26:00 -04:00
5b67140960 call: Fix race condition on stateChangedListeners_
Jamiaccount add a listener while the state is been changed.  This can result in
reallocation of the underlying vector while it's been iterated, resulting in a
read after free.

--------------------------------------------------------------------------------
==930034==ERROR: AddressSanitizer: heap-use-after-free on address 0x603000991900
READ of size 8 at 0x603000991900 thread T1
#0 0x55555a8a6dcb in /ring-project/daemon/src/call.cpp:94
#1 0x55555a8c8483 in /usr/include/c++/11.1.0/bits/invoke.h:61
#2 0x55555a8c654a in /usr/include/c++/11.1.0/bits/invoke.h:111
#3 0x55555a8c4c4e in /usr/include/c++/11.1.0/bits/std_function.h:291
#4 0x55555a8d5102 in /usr/include/c++/11.1.0/bits/std_function.h:560
#5 0x55555a8af158 in /ring-project/daemon/src/call.cpp:270
#6 0x55555a8aff7a in /ring-project/daemon/src/call.cpp:296
#7 0x55555a8b987d in /ring-project/daemon/src/call.cpp:575
#8 0x55555a8b5067 in /ring-project/daemon/src/call.cpp:482
#9 0x55555a8c225b in /ring-project/daemon/src/manager.h:1047
#10 0x55555a8ca928 in /usr/include/c++/11.1.0/bits/invoke.h:61
#11 0x55555a8c88d8 in /usr/include/c++/11.1.0/bits/invoke.h:111
#12 0x55555a8c6878 in /usr/include/c++/11.1.0/bits/std_function.h:291
#13 0x555559cff4a8 in /usr/include/c++/11.1.0/bits/std_function.h:560
#14 0x55555aaae8a1 in /ring-project/daemon/src/scheduled_executor.cpp:137
#15 0x55555aaaaf8f in /ring-project/daemon/src/scheduled_executor.cpp:32
#16 0x55555aab4a2f in /usr/include/c++/11.1.0/bits/invoke.h:61
#17 0x55555aab48ea in /usr/include/c++/11.1.0/bits/invoke.h:96
#18 0x55555aab47bf in /usr/include/c++/11.1.0/bits/std_thread.h:253
#19 0x55555aab46f5 in /usr/include/c++/11.1.0/bits/std_thread.h:260
#20 0x55555aab46ad in /usr/include/c++/11.1.0/bits/std_thread.h:211
#21 0x7ffff45583c3 in /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82
#22 0x7ffff649f258 in /usr/lib/libpthread.so.0+0x9258
#23 0x7ffff38e45e2 in /usr/lib/libc.so.6+0xfe5e2

0x603000991900 is located 0 bytes inside of 32-byte region [0x603000991900,0x603000991920)
freed by thread T0 here:
#0 0x7ffff769fd69 in /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:172
#1 0x55555a1e3dc3 in /usr/include/c++/11.1.0/ext/new_allocator.h:139
#2 0x55555a18f942 in /usr/include/c++/11.1.0/bits/alloc_traits.h:492
#3 0x55555a12a9c1 in /usr/include/c++/11.1.0/bits/stl_vector.h:354
#4 0x55555a12b390 in /usr/include/c++/11.1.0/bits/vector.tcc:500
#5 0x55555a0e1a7c in /usr/include/c++/11.1.0/bits/vector.tcc:121
#6 0x55555a0b8c40 in /ring-project/daemon/src/call.h:286
#7 0x555559f43b69 in /usr/include/c++/11.1.0/bits/jamiaccount.cpp:675
#8 0x555559f3bf91 in /usr/include/c++/11.1.0/bits/jamiaccount.cpp:483
#9 0x555559f39cb7 in /usr/include/c++/11.1.0/bits/jamiaccount.cpp:449
#10 0x55555a838f0e in /ring-project/daemon/src/manager.cpp:3350
#11 0x55555a7f7aef in /ring-project/daemon/src/manager.cpp:1015
#12 0x555559d3c828 in /usr/include/c++/11.1.0/callmanager.cpp:67
#13 0x555559c70b5a in /ring-project/daemon/bin/dring+0x471cb5a
#14 0x555559c7b71a in /ring-project/daemon/bin/dring+0x472771a
#15 0x555559c943af in /ring-project/daemon/bin/dring+0x47403af
#16 0x555559d06102 in /ring-project/daemon/bin/dring+0x47b2102

previously allocated by thread T0 here:
#0 0x7ffff769eca1 in /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
#1 0x55555a21b9e8 in /usr/include/c++/11.1.0/ext/new_allocator.h:121
#2 0x55555a1e4083 in /usr/include/c++/11.1.0/bits/alloc_traits.h:460
#3 0x55555a190197 in /usr/include/c++/11.1.0/bits/stl_vector.h:346
#4 0x55555a12af48 in /usr/include/c++/11.1.0/bits/vector.tcc:440
#5 0x55555a0e1a7c in /usr/include/c++/11.1.0/bits/vector.tcc:121
#6 0x55555a0b8c40 in /ring-project/daemon/src/call.h:286
#7 0x55555a8aaaaa in /ring-project/daemon/src/call.cpp:92
#8 0x55555abcb76d in /usr/include/c++/11.1.0/bits/sipcall.cpp:89
#9 0x55555a7c3341 in /usr/include/c++/11.1.0/ext/new_allocator.h:156
#10 0x55555a7c2185 in /usr/include/c++/11.1.0/bits/alloc_traits.h:512
#11 0x55555a7bfe6d in /usr/include/c++/11.1.0/bits/shared_ptr_base.h:519
#12 0x55555a7bcaa4 in /usr/include/c++/11.1.0/bits/shared_ptr_base.h:650
#13 0x55555a7b85e1 in /usr/include/c++/11.1.0/bits/shared_ptr_base.h:1337
#14 0x55555a7b2d2c in /usr/include/c++/11.1.0/bits/shared_ptr.h:409
#15 0x55555a7af189 in /usr/include/c++/11.1.0/bits/shared_ptr.h:861
#16 0x55555a7abce0 in /usr/include/c++/11.1.0/bits/shared_ptr.h:877
#17 0x55555a7a4782 in /ring-project/daemon/src/call_factory.cpp:54
#18 0x555559f39b16 in /usr/include/c++/11.1.0/bits/jamiaccount.cpp:445
#19 0x55555a838f0e in /ring-project/daemon/src/manager.cpp:3350
#20 0x55555a7f7aef in /ring-project/daemon/src/manager.cpp:1015
#21 0x555559d3c828 in /usr/include/c++/11.1.0/callmanager.cpp:67
#22 0x555559c70b5a in /ring-project/daemon/bin/dring+0x471cb5a
#23 0x555559c7b71a in /ring-project/daemon/bin/dring+0x472771a
#24 0x555559c943af in /ring-project/daemon/bin/dring+0x47403af
#25 0x555559d06102 in /ring-project/daemon/bin/dring+0x47b2102

Thread T1 created by T0 here:
(...)
#2 0x55555aaab6bd in /ring-project/daemon/src/scheduled_executor.cpp:27
#3 0x55555a7e61b3 in /ring-project/daemon/src/manager.cpp:456
#4 0x55555a7eea6c in /ring-project/daemon/src/manager.cpp:736
#5 0x55555a7ee39f in /ring-project/daemon/src/manager.cpp:711
#6 0x555559d3b25f in /ring-project/daemon/src/ring_api.cpp:57
#7 0x555559ae17db in /ring-project/daemon/bin/dring+0x458d7db
#8 0x555559ad1285 in /ring-project/daemon/bin/dring+0x457d285
#9 0x555559acf5e1 in /ring-project/daemon/bin/dring+0x457b5e1
#10 0x555559acf292 in /ring-project/daemon/bin/dring+0x457b292
#11 0x555559ace828 in /ring-project/daemon/bin/dring+0x457a828
#12 0x555559acdb01 in /ring-project/daemon/bin/dring+0x4579b01
#13 0x555559acd33f in /ring-project/daemon/bin/dring+0x457933f
#14 0x555559acbc8d in /ring-project/daemon/bin/dring+0x4577c8d
#15 0x555559aca91b in /ring-project/daemon/bin/dring+0x457691b
#16 0x555559ac8eec in /ring-project/daemon/bin/dring+0x4574eec
#17 0x555559ac693b in /ring-project/daemon/bin/dring+0x457293b
#18 0x7ffff380db24 in /usr/lib/libc.so.6+0x27b24

SUMMARY: AddressSanitizer: heap-use-after-free /ring-project/daemon/src/call.cpp:94 in operator()
Shadow bytes around the buggy address:
  0x0c068012a2d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c068012a2e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c068012a2f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c068012a300: fa fa fa fa fa fa fa fa fa fa fa fa fa fa 00 00
  0x0c068012a310: 00 00 fa fa fa fa fa fa fa fa 00 00 01 fa fa fa
=>0x0c068012a320:[fd]fd fd fd fa fa 00 00 00 07 fa fa fa fa fa fa
  0x0c068012a330: fa fa fd fd fd fd fa fa fd fd fd fa fa fa fd fd
  0x0c068012a340: fd fa fa fa 00 00 01 fa fa fa fa fa fa fa fa fa
  0x0c068012a350: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c068012a360: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c068012a370: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:   00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:   fa
  Freed heap region:   fd
  Stack left redzone:  f1
  Stack mid redzone:   f2
  Stack right redzone: f3
  Stack after return:  f5
  Stack use after scope:   f8
  Global redzone:  f9
  Global init order:   f6
  Poisoned by user:f7
  Container overflow:  fc
  Array cookie:ac
  Intra object redzone:bb
  ASan internal:   fe
  Left alloca redzone: ca
  Right alloca redzone:cb
  Shadow gap:  cc
==930034==ABORTING
--------------------------------------------------------------------------------

Change-Id: I23b4d1017b53a2d7fe224c92527254015e853168
2021-06-11 15:19:20 -04:00
0928c9350d jni: rename Ringservice to JamiService
Change-Id: I8ae187c0a175c05bc7e1421999ff067935b32dbb
2021-06-11 14:53:23 -04:00
88d909fefc jni: update package to net.jami
Change-Id: I1b4dd0f9cba07cc343a7dfb707333f210359503a
2021-06-11 14:52:03 -04:00
6a3cdc99e5 media_const: move MediaAttribute constants to media_const
Change-Id: Ie8513b083d696604b36d6b3ecd868ce184a398d0
2021-06-11 12:35:36 -04:00
d35d214bc5 multi-stream: report the list of negotiated media
Modify the CallSignal::MediaNegotiationStatus signal to report
the list of negotiated media in addition to the status event.

Gitlab: #564

Change-Id: I9ac77656f4f268317ddd87b085f1581ceac0b5b9
2021-06-11 12:35:01 -04:00
53d0ae39d1 multi-stream: check peer's Daemon version
Check peer's Daemon version and ignore media change request
action from the client if the the peer does not support the
feature.
Also bump Daemon version to 10.0.2

Gitlab: #551

Change-Id: Ifd105d2fe2706b4667f5bafabcb3d91e771e7299
2021-06-11 12:33:51 -04:00