WebRTC output DTLS optional for RTCP packets

This commit is contained in:
Ramkoemar 2020-10-27 17:09:56 +01:00 committed by Thulinma
parent 6307428476
commit fff4e2b3d4

View file

@ -1122,11 +1122,14 @@ namespace Mist{
}else{ }else{
//Decrypt feedback packet //Decrypt feedback packet
int len = udp.data.size(); int len = udp.data.size();
if (doDTLS){
if (srtpReader.unprotectRtcp((uint8_t *)(char*)udp.data, &len) != 0){ if (srtpReader.unprotectRtcp((uint8_t *)(char*)udp.data, &len) != 0){
if (packetLog.is_open()){packetLog << "[" << Util::bootMS() << "]" << "RTCP decrypt failure" << std::endl;} if (packetLog.is_open()){packetLog << "[" << Util::bootMS() << "]" << "RTCP decrypt failure" << std::endl;}
FAIL_MSG("Failed to unprotect RTCP."); FAIL_MSG("Failed to unprotect RTCP.");
return; return;
} }
}
lastRecv = Util::bootMS(); lastRecv = Util::bootMS();
uint8_t fmt = udp.data[0] & 0x1F; uint8_t fmt = udp.data[0] & 0x1F;
if (pt == 77 || pt == 65){ if (pt == 77 || pt == 65){