diff --git a/src/SIPSorcery/net/WebRTC/RTCDataChannel.cs b/src/SIPSorcery/net/WebRTC/RTCDataChannel.cs index 8a0d0b570..261373d1d 100644 --- a/src/SIPSorcery/net/WebRTC/RTCDataChannel.cs +++ b/src/SIPSorcery/net/WebRTC/RTCDataChannel.cs @@ -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}."); } else if (_transport.state != RTCSctpTransportState.Connected) { @@ -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}."); } else if (_transport.state != RTCSctpTransportState.Connected) { diff --git a/src/SIPSorcery/net/WebRTC/RTCPeerConnection.cs b/src/SIPSorcery/net/WebRTC/RTCPeerConnection.cs index 4c2b39b72..80866db1c 100644 --- a/src/SIPSorcery/net/WebRTC/RTCPeerConnection.cs +++ b/src/SIPSorcery/net/WebRTC/RTCPeerConnection.cs @@ -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"); diff --git a/src/SIPSorcery/net/WebRTC/RTCSctpTransport.cs b/src/SIPSorcery/net/WebRTC/RTCSctpTransport.cs index e8088412a..91739fcbe 100644 --- a/src/SIPSorcery/net/WebRTC/RTCSctpTransport.cs +++ b/src/SIPSorcery/net/WebRTC/RTCSctpTransport.cs @@ -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)