summary refs log tree commit diff stats
path: root/src/main/java/ganarchy/friendcode/sam/I2PSamControl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/ganarchy/friendcode/sam/I2PSamControl.java')
-rw-r--r--src/main/java/ganarchy/friendcode/sam/I2PSamControl.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/ganarchy/friendcode/sam/I2PSamControl.java b/src/main/java/ganarchy/friendcode/sam/I2PSamControl.java
index 693cba3..50748e6 100644
--- a/src/main/java/ganarchy/friendcode/sam/I2PSamControl.java
+++ b/src/main/java/ganarchy/friendcode/sam/I2PSamControl.java
@@ -12,7 +12,7 @@ public class I2PSamControl extends I2PSamStateMachine {
     private final boolean zeroHop;
     /**
      * The session's private key.
-     *
+     * <p>
      * The threat model assumes the local machine (including RAM) to be trusted.
      */
     private String privateKey;
@@ -25,7 +25,7 @@ public class I2PSamControl extends I2PSamStateMachine {
     /**
      * Creates a new SAM control socket.
      *
-     * @param zeroHop Whether to use zero-hop tunnels.
+     * @param zeroHop    Whether to use zero-hop tunnels.
      * @param privateKey The (optional) identity private key, for persistent friend codes.
      */
     public I2PSamControl(boolean zeroHop, String privateKey) {
@@ -39,12 +39,12 @@ public class I2PSamControl extends I2PSamStateMachine {
             // try IPv6 first
             // there's no Inet6Address.getLoopbackAddress() which is unfortunate.
             final Socket samSocket = new Socket();
-            samSocket.connect(new InetSocketAddress(Inet6Address.getByAddress("localhost", new byte[] {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}, 0), 7656), 3000);
+            samSocket.connect(new InetSocketAddress(Inet6Address.getByAddress("localhost", new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, 0), 7656), 3000);
             return this.connect(samSocket);
         } catch (IOException e) {
             try {
                 final Socket samSocket = new Socket();
-                samSocket.connect(new InetSocketAddress(Inet4Address.getByAddress("localhost", new byte[] {127,0,0,1}), 7656), 3000);
+                samSocket.connect(new InetSocketAddress(Inet4Address.getByAddress("localhost", new byte[] {127, 0, 0, 1}), 7656), 3000);
                 return this.connect(samSocket);
             } catch (IOException ex) {
                 return false;
@@ -63,8 +63,8 @@ public class I2PSamControl extends I2PSamStateMachine {
             if (this.privateKey == null) {
                 // generate our keys
                 this.sendCommand(new I2PSamCommand(
-                        "DEST", "GENERATE",
-                        ImmutableMap.of("SIGNATURE_TYPE", "EdDSA_SHA512_Ed25519")
+                    "DEST", "GENERATE",
+                    ImmutableMap.of("SIGNATURE_TYPE", "EdDSA_SHA512_Ed25519")
                 ));
                 var dest = this.getCommand("DEST", "REPLY");
                 this.publicKey = dest.parameters().get("PUB");
@@ -125,6 +125,7 @@ public class I2PSamControl extends I2PSamStateMachine {
 
     /**
      * Creates a stream forwarder.
+     *
      * @return A stream forwarder.
      */
     public I2PSamStreamForwarder forwardStream(String port) {
@@ -133,6 +134,7 @@ public class I2PSamControl extends I2PSamStateMachine {
 
     /**
      * Creates a stream forwarder.
+     *
      * @return A stream connector.
      */
     public I2PSamStreamConnector connectStream(String b32) {