Implement BQP transport descriptors

This commit is contained in:
str4d
2016-01-28 23:23:43 +00:00
parent 65316414ea
commit d2d8d9d46e
11 changed files with 347 additions and 14 deletions

View File

@@ -161,6 +161,13 @@ class PluginManagerImpl implements PluginManager, Service {
return Collections.unmodifiableList(supported);
}
public Collection<DuplexPlugin> getKeyAgreementPlugins() {
List<DuplexPlugin> supported = new ArrayList<DuplexPlugin>();
for (DuplexPlugin d : duplexPlugins)
if (d.supportsKeyAgreement()) supported.add(d);
return Collections.unmodifiableList(supported);
}
private class SimplexPluginStarter implements Runnable {
private final SimplexPluginFactory factory;

View File

@@ -2,6 +2,8 @@ package org.briarproject.plugins.tcp;
import org.briarproject.api.contact.ContactId;
import org.briarproject.api.crypto.PseudoRandom;
import org.briarproject.api.keyagreement.KeyAgreementListener;
import org.briarproject.api.keyagreement.TransportDescriptor;
import org.briarproject.api.plugins.Backoff;
import org.briarproject.api.plugins.duplex.DuplexPlugin;
import org.briarproject.api.plugins.duplex.DuplexPluginCallback;
@@ -250,6 +252,20 @@ abstract class TcpPlugin implements DuplexPlugin {
throw new UnsupportedOperationException();
}
public boolean supportsKeyAgreement() {
return false;
}
public KeyAgreementListener createKeyAgreementListener(
byte[] commitment) {
throw new UnsupportedOperationException();
}
public DuplexTransportConnection createKeyAgreementConnection(
byte[] commitment, TransportDescriptor d, long timeout) {
throw new UnsupportedOperationException();
}
protected Collection<InetAddress> getLocalIpAddresses() {
List<NetworkInterface> ifaces;
try {