Update to zrtp4j-light v3.1.0

Update zrtp4j-light that implements new features to negotiate ZRP protocol
versions, support the B256 SAS authentication mode, some smaller updates and
bug fixes.
cusax-fix
Werner Dittmann 13 years ago
parent 1d36659054
commit 39c1998b9f

@ -339,25 +339,33 @@ && getPeer().getCall().isSipZrtpAttribute()
srtpControls.put(key, control);
}
String helloHash[] = ((ZrtpControl)control).getHelloHashSep();
ZrtpControl zcontrol = (ZrtpControl) control;
int versionIndex = zcontrol.getNumberSupportedVersions();
boolean zrtpHashSet = false; // will become true if at least one is set
if(helloHash != null && helloHash[1].length() > 0)
for (int i = 0; i < versionIndex; i++)
{
ZrtpHashPacketExtension hash = new ZrtpHashPacketExtension();
hash.setVersion(helloHash[0]);
hash.setValue(helloHash[1]);
EncryptionPacketExtension encryption
= description.getFirstChildOfType(
EncryptionPacketExtension.class);
if(encryption == null)
String helloHash[] = ((ZrtpControl) control).getHelloHashSep(i);
if (helloHash != null && helloHash[1].length() > 0)
{
encryption = new EncryptionPacketExtension();
description.addChildExtension(encryption);
ZrtpHashPacketExtension hash =
new ZrtpHashPacketExtension();
hash.setVersion(helloHash[0]);
hash.setValue(helloHash[1]);
EncryptionPacketExtension encryption =
description
.getFirstChildOfType(EncryptionPacketExtension.class);
if (encryption == null)
{
encryption = new EncryptionPacketExtension();
description.addChildExtension(encryption);
}
encryption.addChildExtension(hash);
zrtpHashSet = true;
}
encryption.addChildExtension(hash);
return true;
}
return zrtpHashSet;
}
return false;

@ -680,13 +680,19 @@ private boolean updateMediaDescriptionForZrtp(
}
ZrtpControl zcontrol = (ZrtpControl) scontrol;
String helloHash = zcontrol.getHelloHash();
int versionIndex = zcontrol.getNumberSupportedVersions();
boolean zrtpHashSet = false; // will become true if at least one is set
if(helloHash != null && helloHash.length() > 0)
{
md.setAttribute(SdpUtils.ZRTP_HASH_ATTR, helloHash);
return true;
for (int i = 0; i < versionIndex; i++) {
String helloHash = zcontrol.getHelloHash(i);
if (helloHash != null && helloHash.length() > 0)
{
md.setAttribute(SdpUtils.ZRTP_HASH_ATTR, helloHash);
zrtpHashSet = true;
}
}
return zrtpHashSet;
}
catch (SdpException ex)
{

Loading…
Cancel
Save