Package com.subgraph.orchid

Examples of com.subgraph.orchid.InternalCircuit


    }
    return circuit;
  }

  public InternalCircuit openInternalCircuitTo(List<Router> path) throws OpenFailedException {
    final InternalCircuit circuit = CircuitImpl.createInternalCircuitTo(this, path);
    if(!tryOpenCircuit(circuit, false, false)) {
      throw new OpenFailedException("Could not create internal circuit for path");
    }
    return circuit;
  }
View Full Code Here


 
  public HiddenServiceCircuit call() throws Exception {
   
    logger.fine("Opening rendezvous circuit for "+ logServiceName());
   
    final InternalCircuit rendezvous = circuitManager.getCleanInternalCircuit();
    logger.fine("Establishing rendezvous for "+ logServiceName());
    RendezvousProcessor rp = new RendezvousProcessor(rendezvous);
    if(!rp.establishRendezvous()) {
      rendezvous.markForClose();
      return null;
    }
    logger.fine("Opening introduction circuit for "+ logServiceName());
    final IntroductionProcessor introductionProcessor = openIntroduction();
    if(introductionProcessor == null) {
      logger.info("Failed to open connection to any introduction point");
      rendezvous.markForClose();
      return null;
    }
    logger.fine("Sending introduce cell for "+ logServiceName());
    final TorTapKeyAgreement kex = new TorTapKeyAgreement();
    final boolean icResult = introductionProcessor.sendIntroduce(introductionProcessor.getServiceKey(), kex.getPublicKeyBytes(), rp.getCookie(), rp.getRendezvousRouter());
    introductionProcessor.markCircuitForClose();
    if(!icResult) {
      rendezvous.markForClose();
      return null;
    }
    logger.fine("Processing RV2 for "+ logServiceName());
    HiddenServiceCircuit hsc = rp.processRendezvous2(kex);
    if(hsc == null) {
      rendezvous.markForClose();
    }

    logger.fine("Rendezvous circuit opened for "+ logServiceName());
   
    return hsc;
View Full Code Here

    if(r == null) {
      return null;
    }
   
    try {
      final InternalCircuit circuit = circuitManager.getCleanInternalCircuit();
      return circuit.cannibalizeToIntroductionPoint(r);
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      return null;
    } catch (TorException e) {
      logger.fine("cannibalizeTo() failed : "+ e.getMessage());
View Full Code Here

   
  }
 
  private Stream openHSDirectoryStream(Router directory) throws TimeoutException, InterruptedException, OpenFailedException {

    final InternalCircuit circuit = circuitManager.getCleanInternalCircuit();
   
    try {
      final DirectoryCircuit dc = circuit.cannibalizeToDirectory(directory);
      return dc.openDirectoryStream(10000, true);
    } catch (StreamConnectFailedException e) {
      circuit.markForClose();
      throw new OpenFailedException("Failed to open directory stream");
    } catch (TorException e) {
      circuit.markForClose();
      throw new OpenFailedException("Failed to extend circuit to HS directory: "+ e.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of com.subgraph.orchid.InternalCircuit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.