Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/SIPSorcery/net/WebRTC/RTCDataChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ public void send(string message)
{
if (message != null && Encoding.UTF8.GetByteCount(message) > _transport.maxMessageSize)
{
throw new ApplicationException($"Data channel {label} was requested to send data of length {Encoding.UTF8.GetByteCount(message)} " +
$" that exceeded the maximum allowed message size of {_transport.maxMessageSize}.");
throw new ApplicationException($"Data channel {label} was requested to send data of length {Encoding.UTF8.GetByteCount(message)} that exceeded the maximum allowed message size of {_transport.maxMessageSize}.");
Comment thread
sipsorcery marked this conversation as resolved.
Outdated
}
else if (_transport.state != RTCSctpTransportState.Connected)
{
Expand Down Expand Up @@ -173,8 +172,7 @@ public void send(byte[] data, int offset = 0, int count = -1)

if (effectiveCount > _transport.maxMessageSize)
{
throw new ApplicationException($"Data channel {label} was requested to send data of length {effectiveCount} " +
$" that exceeded the maximum allowed message size of {_transport.maxMessageSize}.");
throw new ApplicationException($"Data channel {label} was requested to send data of length {effectiveCount} that exceeded the maximum allowed message size of {_transport.maxMessageSize}.");
Comment thread
sipsorcery marked this conversation as resolved.
Outdated
}
else if (_transport.state != RTCSctpTransportState.Connected)
{
Expand Down
5 changes: 3 additions & 2 deletions src/SIPSorcery/net/WebRTC/RTCPeerConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1876,12 +1876,13 @@ private bool DoDtlsHandshake(DtlsSrtpTransport dtlsHandle)
}
else
{
logger.LogDebug($"RTCPeerConnection DTLS handshake result {handshakeResult}, is handshake complete {dtlsHandle.IsHandshakeComplete()}.");
logger.LogDebug("RTCPeerConnection DTLS handshake result {HandshakeResult}, is handshake complete {IsHandshakeComplete}.",
handshakeResult, dtlsHandle.IsHandshakeComplete());

var expectedFp = RemotePeerDtlsFingerprint;
var remoteFingerprint = DtlsUtils.Fingerprint(expectedFp.algorithm, dtlsHandle.GetRemoteCertificate().GetCertificateAt(0));

if (remoteFingerprint.value?.ToUpper() != expectedFp.value?.ToUpper())
if (!string.Equals(remoteFingerprint.value, expectedFp.value, StringComparison.OrdinalIgnoreCase))
{
logger.LogWarning("RTCPeerConnection remote certificate fingerprint mismatch, expected {ExpectedFingerprint}, actual {RemoteFingerprint}.", expectedFp, remoteFingerprint);
Close("dtls fingerprint mismatch");
Expand Down
3 changes: 1 addition & 2 deletions src/SIPSorcery/net/WebRTC/RTCSctpTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,7 @@ public override void Send(string associationID, byte[] buffer, int offset, int l
{
if (length > maxMessageSize)
{
throw new ApplicationException($"RTCSctpTransport was requested to send data of length {length} " +
$" that exceeded the maximum allowed message size of {maxMessageSize}.");
throw new ApplicationException($"RTCSctpTransport was requested to send data of length {length} that exceeded the maximum allowed message size of {maxMessageSize}.");
}

if (!_isClosed)
Expand Down
Loading