aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2021-04-09 22:23:53 +0200
committerMarvin W <git@larma.de>2021-04-09 22:23:53 +0200
commitfbc10c2023a4c2b874f87940f0a71bc0d8d7b57d (patch)
tree8e0b900037b543f2ac63b3c0c7f974a7e1ec8121 /xmpp-vala/src/module
parent8d1c6c29be7018c74ec3f8ea05f5849eac5b4069 (diff)
downloaddino-fbc10c2023a4c2b874f87940f0a71bc0d8d7b57d.tar.gz
dino-fbc10c2023a4c2b874f87940f0a71bc0d8d7b57d.zip
DTLS-SRTP: Wait for setup finish and handle setup=passive
Diffstat (limited to 'xmpp-vala/src/module')
-rw-r--r--xmpp-vala/src/module/xep/0167_jingle_rtp/content_parameters.vala3
-rw-r--r--xmpp-vala/src/module/xep/0176_jingle_ice_udp/transport_parameters.vala16
2 files changed, 10 insertions, 9 deletions
diff --git a/xmpp-vala/src/module/xep/0167_jingle_rtp/content_parameters.vala b/xmpp-vala/src/module/xep/0167_jingle_rtp/content_parameters.vala
index ac65f88c..c37c19cc 100644
--- a/xmpp-vala/src/module/xep/0167_jingle_rtp/content_parameters.vala
+++ b/xmpp-vala/src/module/xep/0167_jingle_rtp/content_parameters.vala
@@ -94,6 +94,9 @@ public class Xmpp.Xep.JingleRtp.Parameters : Jingle.ContentParameters, Object {
ulong rtp_ready_handler_id = 0;
rtp_ready_handler_id = rtp_datagram.notify["ready"].connect(() => {
this.stream.on_rtp_ready();
+ if (rtcp_mux) {
+ this.stream.on_rtcp_ready();
+ }
connection_ready();
rtp_datagram.disconnect(rtp_ready_handler_id);
diff --git a/xmpp-vala/src/module/xep/0176_jingle_ice_udp/transport_parameters.vala b/xmpp-vala/src/module/xep/0176_jingle_ice_udp/transport_parameters.vala
index f194f06d..4976f560 100644
--- a/xmpp-vala/src/module/xep/0176_jingle_ice_udp/transport_parameters.vala
+++ b/xmpp-vala/src/module/xep/0176_jingle_ice_udp/transport_parameters.vala
@@ -14,8 +14,10 @@ public abstract class Xmpp.Xep.JingleIceUdp.IceUdpTransportParameters : Jingle.T
public Gee.List<Candidate> remote_candidates = new ArrayList<Candidate>(Candidate.equals_func);
public uint8[]? own_fingerprint = null;
+ public string? own_setup = null;
public uint8[]? peer_fingerprint = null;
public string? peer_fp_algo = null;
+ public string? peer_setup = null;
public Jid local_full_jid { get; private set; }
public Jid peer_full_jid { get; private set; }
@@ -41,8 +43,9 @@ public abstract class Xmpp.Xep.JingleIceUdp.IceUdpTransportParameters : Jingle.T
StanzaNode? fingerprint_node = node.get_subnode("fingerprint", DTLS_NS_URI);
if (fingerprint_node != null) {
- peer_fingerprint = fingerprint_to_bytes(fingerprint_node.get_deep_string_content());
+ peer_fingerprint = fingerprint_to_bytes(fingerprint_node.get_string_content());
peer_fp_algo = fingerprint_node.get_attribute("hash");
+ peer_setup = fingerprint_node.get_attribute("setup");
}
}
}
@@ -73,11 +76,7 @@ public abstract class Xmpp.Xep.JingleIceUdp.IceUdpTransportParameters : Jingle.T
.add_self_xmlns()
.put_attribute("hash", "sha-256")
.put_node(new StanzaNode.text(format_fingerprint(own_fingerprint)));
- if (incoming) {
- fingerprint_node.put_attribute("setup", "active");
- } else {
- fingerprint_node.put_attribute("setup", "actpass");
- }
+ fingerprint_node.put_attribute("setup", own_setup);
node.put_node(fingerprint_node);
}
@@ -101,6 +100,7 @@ public abstract class Xmpp.Xep.JingleIceUdp.IceUdpTransportParameters : Jingle.T
if (fingerprint_node != null) {
peer_fingerprint = fingerprint_to_bytes(fingerprint_node.get_deep_string_content());
peer_fp_algo = fingerprint_node.get_attribute("hash");
+ peer_setup = fingerprint_node.get_attribute("setup");
}
}
@@ -142,8 +142,6 @@ public abstract class Xmpp.Xep.JingleIceUdp.IceUdpTransportParameters : Jingle.T
}
}
-
-
private string format_fingerprint(uint8[] fingerprint) {
var sb = new StringBuilder();
for (int i = 0; i < fingerprint.length; i++) {
@@ -167,4 +165,4 @@ public abstract class Xmpp.Xep.JingleIceUdp.IceUdpTransportParameters : Jingle.T
}
return bin;
}
-} \ No newline at end of file
+}