|
|
|
|
@ -1173,19 +1173,15 @@ private List<String> getRtpTransports()
|
|
|
|
|
* List the secure transports in the result according to the order
|
|
|
|
|
* of preference of their respective encryption protocols.
|
|
|
|
|
*/
|
|
|
|
|
List<String> encryptionProtocols
|
|
|
|
|
List<SrtpControlType> encryptionProtocols
|
|
|
|
|
= accountID.getSortedEnabledEncryptionProtocolList();
|
|
|
|
|
|
|
|
|
|
for (int epi = encryptionProtocols.size() - 1; epi >= 0; epi--)
|
|
|
|
|
{
|
|
|
|
|
String encryptionProtocol = encryptionProtocols.get(epi);
|
|
|
|
|
String protoName
|
|
|
|
|
= encryptionProtocol.substring(
|
|
|
|
|
ProtocolProviderFactory.ENCRYPTION_PROTOCOL.length()
|
|
|
|
|
+ 1);
|
|
|
|
|
SrtpControlType srtpControlType = encryptionProtocols.get(epi);
|
|
|
|
|
String[] protos;
|
|
|
|
|
|
|
|
|
|
if (DtlsControl.PROTO_NAME.equals(protoName))
|
|
|
|
|
if (srtpControlType == SrtpControlType.DTLS_SRTP)
|
|
|
|
|
{
|
|
|
|
|
protos
|
|
|
|
|
= new String[]
|
|
|
|
|
@ -1738,21 +1734,16 @@ protected void setAndAddPreferredEncryptionProtocol(
|
|
|
|
|
MediaDescription remoteMd)
|
|
|
|
|
{
|
|
|
|
|
// Sets ZRTP or SDES, depending on the preferences for this account.
|
|
|
|
|
List<String> preferredEncryptionProtocols
|
|
|
|
|
List<SrtpControlType> preferredEncryptionProtocols
|
|
|
|
|
= getPeer()
|
|
|
|
|
.getProtocolProvider()
|
|
|
|
|
.getAccountID()
|
|
|
|
|
.getSortedEnabledEncryptionProtocolList();
|
|
|
|
|
|
|
|
|
|
for(String preferredEncryptionProtocol : preferredEncryptionProtocols)
|
|
|
|
|
for(SrtpControlType srtpControlType : preferredEncryptionProtocols)
|
|
|
|
|
{
|
|
|
|
|
String protoName
|
|
|
|
|
= preferredEncryptionProtocol.substring(
|
|
|
|
|
ProtocolProviderFactory.ENCRYPTION_PROTOCOL.length()
|
|
|
|
|
+ 1);
|
|
|
|
|
|
|
|
|
|
// DTLS-SRTP
|
|
|
|
|
if (DtlsControl.PROTO_NAME.equals(protoName))
|
|
|
|
|
if (srtpControlType == SrtpControlType.DTLS_SRTP)
|
|
|
|
|
{
|
|
|
|
|
if(updateMediaDescriptionForDtls(mediaType, localMd, remoteMd))
|
|
|
|
|
{
|
|
|
|
|
@ -1761,7 +1752,7 @@ protected void setAndAddPreferredEncryptionProtocol(
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// SDES
|
|
|
|
|
else if(SDesControl.PROTO_NAME.equals(protoName))
|
|
|
|
|
else if(srtpControlType == SrtpControlType.SDES)
|
|
|
|
|
{
|
|
|
|
|
if(updateMediaDescriptionForSDes(mediaType, localMd, remoteMd))
|
|
|
|
|
{
|
|
|
|
|
@ -1770,7 +1761,7 @@ else if(SDesControl.PROTO_NAME.equals(protoName))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// ZRTP
|
|
|
|
|
else if(ZrtpControl.PROTO_NAME.equals(protoName))
|
|
|
|
|
else if(srtpControlType == SrtpControlType.ZRTP)
|
|
|
|
|
{
|
|
|
|
|
if(updateMediaDescriptionForZrtp(mediaType, localMd, remoteMd))
|
|
|
|
|
{
|
|
|
|
|
|