From f7dc55f0875e28c12512489d934b27ac6f88fa1d Mon Sep 17 00:00:00 2001 From: zzz Date: Fri, 16 Mar 2012 12:07:13 +0000 Subject: [PATCH] * HTTP Proxy: Jump and addresshelper page tweaks --- .../src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java index 96f6191f8..624af0e11 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java @@ -32,6 +32,7 @@ import net.i2p.client.naming.NamingService; import net.i2p.client.streaming.I2PSocket; import net.i2p.client.streaming.I2PSocketManager; import net.i2p.client.streaming.I2PSocketOptions; +import net.i2p.crypto.SHA256Generator; import net.i2p.data.Base32; import net.i2p.data.Base64; import net.i2p.data.DataFormatException; @@ -981,8 +982,14 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn return; byte[] header = getErrorPage("ahelper-new", ERR_AHELPER_NEW); out.write(header); - out.write(("\n" + - "
" + _("Host") + "" + destination + "
" + _("Destination") + "" + + out.write(("\n").getBytes()); + try { + String b32 = Base32.encode(SHA256Generator.getInstance().calculateHash(Base64.decode(ahelperKey)).getData()); + out.write(("" + + "").getBytes()); + } catch (Exception e) {} + out.write(("
" + _("Host") + + "" + destination + "
" + _("Base 32") + "" + b32 + ".b32.i2p
" + _("Destination") + "" + "
\n" + "
"+ @@ -1179,7 +1186,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn out.write(jurl.getBytes()); out.write(uri.getBytes()); out.write("\">".getBytes()); - out.write(jurl.getBytes()); + out.write(jurl.substring(7).getBytes()); out.write(uri.getBytes()); out.write("\n".getBytes()); }