Replace SRTP protocol string constants with their enum.

This should have been in 5cf2a26673 but
the compiler somehow fooled me.
fix-message-formatting
Ingo Bauersachs 12 years ago
parent 5cf2a26673
commit b3bf8d30c8

@ -113,7 +113,7 @@ protected void addZrtpAdvertisedEncryptions(
ProtocolProviderFactory.DEFAULT_ENCRYPTION,
true)
&& accountID.isEncryptionProtocolEnabled(
ZrtpControl.PROTO_NAME)
SrtpControlType.ZRTP)
&& call.isSipZrtpAttribute())
{
// ZRTP
@ -169,7 +169,7 @@ protected void addSDesAdvertisedEncryptions(
ProtocolProviderFactory.DEFAULT_ENCRYPTION,
true)
&& accountID.isEncryptionProtocolEnabled(
SDesControl.PROTO_NAME))
SrtpControlType.SDES))
{
SrtpControls srtpControls = getSrtpControls();
SDesControl sdesControl
@ -320,7 +320,7 @@ protected boolean setZrtpEncryptionOnDescription(
ProtocolProviderFactory.DEFAULT_ENCRYPTION,
true)
&& accountID.isEncryptionProtocolEnabled(
ZrtpControl.PROTO_NAME)
SrtpControlType.ZRTP)
&& call.isSipZrtpAttribute())
{
ZrtpControl zrtpControl
@ -398,7 +398,7 @@ protected boolean setSDesEncryptionOnDescription(
ProtocolProviderFactory.DEFAULT_ENCRYPTION,
true)
&& accountID.isEncryptionProtocolEnabled(
SDesControl.PROTO_NAME))
SrtpControlType.SDES))
{
// get or create the control
SrtpControls srtpControls = getSrtpControls();

@ -789,7 +789,7 @@ private boolean updateMediaDescriptionForDtls(
ProtocolProviderFactory.DEFAULT_ENCRYPTION,
true)
&& accountID.isEncryptionProtocolEnabled(
DtlsControl.PROTO_NAME))
SrtpControlType.DTLS_SRTP))
{
/*
* The transport protocol of the media described by localMd should
@ -1019,7 +1019,7 @@ private boolean updateMediaDescriptionForSDes(
ProtocolProviderFactory.DEFAULT_ENCRYPTION,
true)
|| !accountID.isEncryptionProtocolEnabled(
SDesControl.PROTO_NAME))
SrtpControlType.SDES))
{
return false;
}
@ -1102,7 +1102,7 @@ private boolean updateMediaDescriptionForZrtp(
if(accountID.getAccountPropertyBoolean(
ProtocolProviderFactory.DEFAULT_ENCRYPTION,
true)
&& accountID.isEncryptionProtocolEnabled(ZrtpControl.PROTO_NAME)
&& accountID.isEncryptionProtocolEnabled(SrtpControlType.ZRTP)
&& peer.getCall().isSipZrtpAttribute())
{
ZrtpControl zrtpControl

@ -795,16 +795,16 @@ public void setAccountProperties(Map<String, String> accountProperties)
* @param encryptionProtocolName The name of the encryption protocol
* ("ZRTP", "SDES" or "MIKEY").
*/
public boolean isEncryptionProtocolEnabled(String encryptionProtocolName)
public boolean isEncryptionProtocolEnabled(SrtpControlType type)
{
// The default value is false, except for ZRTP.
boolean defaultValue = "ZRTP".equals(encryptionProtocolName);
boolean defaultValue = type == SrtpControlType.ZRTP;
return
getAccountPropertyBoolean(
ProtocolProviderFactory.ENCRYPTION_PROTOCOL_STATUS
+ "."
+ encryptionProtocolName,
+ type.toString(),
defaultValue);
}

@ -29,9 +29,9 @@ public abstract class SecurityAccountRegistration
public static final List<String> ENCRYPTION_PROTOCOLS
= Collections.unmodifiableList(
Arrays.asList(
ZrtpControl.PROTO_NAME,
SDesControl.PROTO_NAME,
DtlsControl.PROTO_NAME));
SrtpControlType.ZRTP.toString(),
SrtpControlType.SDES.toString(),
SrtpControlType.DTLS_SRTP.toString()));
/**
* Enables support to encrypt calls.

Loading…
Cancel
Save