Daniel McAssey
fbebebd75d
fix: logger calling wrong function typo
4 jaren geleden
Saúl Ibarra Corretgé
86f6c25638
fix(e2ee) replace nullish coalescing with or
For some reason webpack seems to not be transpiling that properly.
Fixes: https://github.com/jitsi/lib-jitsi-meet/issues/1722
4 jaren geleden
tmoldovan8x8
2e1ca64654
fix(e2ee) restore initial key when RATCHET_WINDOW_SIZE reached
4 jaren geleden
Saúl Ibarra Corretgé
61c977f70a
feat(e2ee) add support for WebRTC Encoded Transform
An alternative to Insertable Streams, currently implemented in Safarii / WebKit.
https://w3c.github.io/webrtc-encoded-transform/
Fixes: https://github.com/jitsi/jitsi-meet/issues/9585
4 jaren geleden
Philipp Hancke
ba2958c014
e2ee: remove legacy apis (#1653)
remove legacy APIs which are not even supported anymore
4 jaren geleden
tmoldovan8x8
dd902dd33d
fix(e2ee): destroys olm session on disabling e2ee
4 jaren geleden
Jaya Allamsetty
17f968fdea
fix(logger): Logging enhancements.
Get rid of noisy logs related to SDP transformations which are redundant. Fix formatting and add missing information.
4 jaren geleden
tmoldovan8x8
e354745db5
task(e2ee): switch back to GCM
4 jaren geleden
tmoldovan8x8
49c4e75f37
bugfix(e2ee): frees olm session and rotates key when remote participant disabled e2ee
4 jaren geleden
tmoldovan8x8
2b94da12e8
feat(e2ee): makes olm sessions initialisation lazy
4 jaren geleden
Saúl Ibarra Corretgé
cacf6c7b56
feat(e2ee) update to SFrame draft -02
Drop end to end signature. The impersonation attack vector is deemed out of
scope since insiders are already part of the meeting.
4 jaren geleden
Saúl Ibarra Corretgé
6a7b16c33e
fix(e2ee) fix disabling E2EE
When E2EE is disabled we need just set the last key to `false`. When decoding we
need to check if the last key is not false, otherwise we might try to decrypt
the unencrypted video frames, thus resulting in breakage.
4 jaren geleden
Ahmet Sarı
16aaa125dd
fix(e2ee) fix key index after ratchetting
- After ratchet do not set it as new key for current index. Set it to correct position in crypto ring.
4 jaren geleden
Philipp Hancke
6784189600
(feat) e2ee: sign and verify frames (#1373)
Signs and verifies frames. For now this is done on every frame.
This is not the long-term goal and there needs to be a better strategy.
5 jaren geleden
Saúl Ibarra Corretgé
c77487685e
feat(e2ee) log Olm version
5 jaren geleden
Saúl Ibarra Corretgé
b65b1784df
feat(e2ee) publish olm id key in presence
5 jaren geleden
Saúl Ibarra Corretgé
b5aeba27b9
feat(e2ee) emit PARTICIPANT_E2EE_CHANNEL_READY also for the initiator
5 jaren geleden
Philipp Hancke
9331243236
e2ee: rename constants to upper-case
and add a few new ones.
5 jaren geleden
Philipp Hancke
9e10554e55
e2ee: clean up tests
and make them a bit more concise. No functional changes
5 jaren geleden
Philipp Hancke
00c8cfad98
e2ee: sync key ring size and packet format
this uses the full four bits in the wire format. The wire format
looses the (currently not implemented) extensibility with variable
length keys.
5 jaren geleden
Philipp Hancke
666f1006de
e2ee: add unit tests
Both for just encode function as well as an end-to-end test.
5 jaren geleden
Philipp Hancke
687a82e5a1
e2ee: move context to separate file
to allow writing tests
5 jaren geleden
Philipp Hancke
12604d96ff
e2ee: refactor and clean up
in particular this allows sharing the ratcheting between the E2EEncryption
module and the Worker.
5 jaren geleden
Saúl Ibarra Corretgé
25f08f97c3
e2ee: sync ratchetted key with olm layer
5 jaren geleden
Saúl Ibarra Corretgé
159ea5357b
e2ee: remove no longer needed code
5 jaren geleden
Philipp Hancke
4a6e493f41
e2ee: Ratchet the key forward on authentication tag errors
similar to what is explained here:
https://tools.ietf.org/html/draft-omara-sframe-00#section-4.3.5.1
but we do it on authentication tag failures since it is not possible
to tell whether decrypt.
5 jaren geleden
Philipp Hancke
4b71f96beb
e2ee: fix authentication tag check
this needs to be called with an Uint8Array, not an ArrayBuffer
5 jaren geleden
Philipp Hancke
b6821ddb65
e2ee: refactor to make it clear when to ratchet
refactor the signature checking to make it clear when we need to ratchet.
This is similar to
https://tools.ietf.org/html/draft-omara-sframe-00#section-4.3.5.1
but we verify the hash before attempting to decrypt.
5 jaren geleden
Philipp Hancke
85fde1aeae
e2ee: use CTR instead of GCM
following
https://tools.ietf.org/html/draft-omara-sframe-00
but putting the frame metadata into a trailer instead of a header.
We call this JFrame.
Also the key we get from OLM is high entropy so we do not need
to use PBKDF2 but can use HKDF instead. See
https://wiki.developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/deriveKey#HKDF
5 jaren geleden
Saúl Ibarra Corretgé
f761413976
e2ee: avoid CORS issues with the worker bundle
5 jaren geleden
Saúl Ibarra Corretgé
735c30ec4f
e2ee: introduce per-participant randomly generated keys
This the second stage in our E2EE journey.
Instead of using a single pre-shared passphrase for deriving the key used for
E2EE, we now establish a secure E2EE communication channel amongst peers.
This channel is implemented using libolm, using XMPP groupchat or JVB channels
as the transport.
Once the secure E2EE channel has been established each participant will generate
a random 32 byte key and exchange it over this channel.
Keys are rotated (well, just re-created at the moment) when a participant joins
or leaves.
5 jaren geleden
Saúl Ibarra Corretgé
5322ddd6b5
e2ee: use a separate bundle for the worker
Avoid having to use a code blob.
5 jaren geleden
Philipp Hancke
92ea388ce9
e2ee: update for latest chrome changes
see https://bugs.chromium.org/p/chromium/issues/detail?id=1119653
We'll probably do similar renaming in the future.
5 jaren geleden
Saúl Ibarra Corretgé
0e328c9b82
deps: eslint-config-jitsi@latest
5 jaren geleden
paweldomas
ddb3ed92b5
ref(e2ee): extract E2EEncryption module
Moves the logics which deal with JitsiConference events to a separate module.
5 jaren geleden
Philipp Hancke
2a7d854169
e2ee: update for latest spec changes in Chrome M84
which landed in
https://bugs.chromium.org/p/chromium/issues/detail?id=1069295#c4
5 jaren geleden
Philipp Hancke
cbad14bc48
e2ee: derive per-participant keys
derived from the participant id in addition to the salt, separated by a null
byte to avoid ambiguity attacks along the lines of
(someRoom, someParticipant)
(someRoo, mSomeParticipant)
5 jaren geleden
Philipp Hancke
966f75af73
e2ee: make it easier to change the AES key length
as suggested during the community call recently
5 jaren geleden
Philipp Hancke
b9afcdd6fb
e2ee: move to per-participant contexts
moves the cryptography bit to a datastructure which allows per-sender keys.
Does not yet use per-sender keys.
Also fixes lots of lint errors in the worker.
5 jaren geleden
Philipp Hancke
b0dbdb6c5a
e2ee: pass local and remote ids
currently unused, will allow moving to per-participant keys
5 jaren geleden
Alfredo Irarrazaval
334a2b1172
fixed critical typos (#1131)
5 jaren geleden
Saúl Ibarra Corretgé
3f1828e77c
e2ee: lazily create the worker URL
Mobile breaks otherwise, since creating those types of URLs are supported.
5 jaren geleden
Philipp Hancke
ba0777f0cf
e2ee: move to a worker (#1112)
Moveѕ e2ee operations to a worker that is included as text/blob for now
to simplify deployment.
5 jaren geleden
Philipp Hancke
3ed8210620
e2ee: don't pass plain frames to decoder if we are encrypting (#1116)
If we are encrypting and the key index from a (potentially unencrypted)
frame exceeds our key ring size (1 currently) drop the frame.
This is a heuristic. We currently don't have the signaling for whether a
remote end does encrypt its frames or not.
5 jaren geleden
Philipp Hancke
cc1114434c
e2ee: drop video on decode errors (#1114)
Reverts #1098 , that strategy does not work. When switching from garbage to non-garbage the decoder
would decode subsequent packets based on the wrong keyframe.
5 jaren geleden
Philipp Hancke
37770a44c9
e2ee: increase logging for decode errors (#1103)
5 jaren geleden
Philipp Hancke
c3fd3431a6
e2ee: remove encodedFrameType workaround (#1099)
no longer required as of Chrome 84.0.4108.0 and has been merged into M83 as well.
5 jaren geleden
Philipp Hancke
101fecbb24
e2ee: decode static black frame for decryption errors (#1098)
similar to #1095 use a black keyframe instead of displaying a potentially
unencrypted stream. This was again captured with a modified version of
the webrtc sample, additional logging and a resolution of 320x180
5 jaren geleden
Saúl Ibarra Corretgé
5423a24f18
hips: fix enabling E2EE for tracks added later to the conference
5 jaren geleden
Philipp Hancke
6502bc6782
e2ee: generate silence in case of audio decryption errors
This handles decryption errors for audio differently than the
current version. Instead of forwarding horrible noise to the decoder,
replace the bytes with magic opus bytes for silence:
0xd8fffe
Those bytes were captured on a modified version of
https://webrtc.github.io/samples/src/content/peerconnection/endtoend-encryption/
with more dumping and after disabling the track.
5 jaren geleden