[jitsi-dev] [libjitsi] Unbreak DTLS flights (#119)


#1

The following modifications were applied while trying to remove a 1 second hard minimum on connectivity establishment between Videobridge and Chrome/WebRTC. Related modifications in jitsi-videobridge (i.e. which will be introduced in a branch there with the same name) (will) depend on these.

Of separate interest is commit 32c3e34 which fixes a long-standing issue of breaking DTLS flights into multiple UDP packets. The fix is desirable in the context of optimizing the connectivity establishment i.e. this PR.
You can view, comment on, or merge this pull request online at:

  https://github.com/jitsi/libjitsi/pull/119

-- Commit Summary --

  * Fixes warnings (raised by IntelliJ IDEA).
  * Expands the use of CertificateInfo outside of DtlsControlImpl in preparation for addressing FIXMEs.
  * Collects multiple properties of DtlsControlImpl into a class/structure for easy sharing with DtlsTransformEngine and DtlsPacketTransformer (in sight of early DTLS support).
  * Moves 'user' support from DtlsControlImpl to AbstractSrtpControl.
  * Fixes incorrect offset which causes DTLS records in a flight to be sent separately.
  * Adds a getter for a field with only a setter.
  * Improves javadocs.

-- File Changes --

    M src/org/jitsi/impl/neomedia/transform/dtls/CertificateInfo.java (40)
    M src/org/jitsi/impl/neomedia/transform/dtls/DatagramTransportImpl.java (10)
    M src/org/jitsi/impl/neomedia/transform/dtls/DtlsControlImpl.java (275)
    M src/org/jitsi/impl/neomedia/transform/dtls/DtlsPacketTransformer.java (116)
    M src/org/jitsi/impl/neomedia/transform/dtls/DtlsTransformEngine.java (169)
    A src/org/jitsi/impl/neomedia/transform/dtls/Properties.java (139)
    M src/org/jitsi/impl/neomedia/transform/dtls/TlsClientImpl.java (36)
    M src/org/jitsi/impl/neomedia/transform/dtls/TlsServerImpl.java (102)
    M src/org/jitsi/impl/neomedia/transform/zrtp/ZrtpControlImpl.java (10)
    M src/org/jitsi/service/neomedia/AbstractSrtpControl.java (34)
    M src/org/jitsi/service/neomedia/SrtpControl.java (9)

-- Patch Links --

https://github.com/jitsi/libjitsi/pull/119.patch
https://github.com/jitsi/libjitsi/pull/119.diff

···

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/119


#2

@@ -482,7 +482,15 @@ public void send(byte[] buf, int off, int len)
             switch (type)
             {
             case ContentType.handshake:
- short msg_type = TlsUtils.readUint8(buf, off + 11);
+ short msg_type
+ = TlsUtils.readUint8(
+ buf,
+ off
+ + 1 /* type */
+ + 2 /* version */
+ + 2 /* epoch */
+ + 6 /* sequence_number */
+ + 2 /* length */);

Maybe we should print a warning when we encounter an unknown message type (the "default" in the switch statement below)?

···


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/119/files/8f10c8bdc552ff178976c0469bc8e937425c9196..32c3e34606ac4c20ee921d8cfa295ba10d79818c#r57624752


#3

@@ -482,7 +482,15 @@ public void send(byte[] buf, int off, int len)
             switch (type)
             {
             case ContentType.handshake:
- short msg_type = TlsUtils.readUint8(buf, off + 11);
+ short msg_type
+ = TlsUtils.readUint8(
+ buf,
+ off
+ + 1 /* type */
+ + 2 /* version */
+ + 2 /* epoch */
+ + 6 /* sequence_number */
+ + 2 /* length */);

OK, thank you. I'll do that.

···


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/119/files/8f10c8bdc552ff178976c0469bc8e937425c9196..32c3e34606ac4c20ee921d8cfa295ba10d79818c#r57625273


#4

Merged #119.

···

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/119#event-605715804