diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java index e328f64aec..4c9d3f1264 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java @@ -8,6 +8,7 @@ package net.i2p.i2ptunnel.web; * */ +import java.io.File; import java.io.IOException; import java.util.List; import java.util.Set; @@ -79,7 +80,10 @@ public class EditBean extends IndexBean { return ""; String keyFile = tun.getPrivKeyFile(); if (keyFile != null && keyFile.trim().length() > 0) { - PrivateKeyFile pkf = new PrivateKeyFile(keyFile); + File f = new File(keyFile); + if (!f.isAbsolute()) + f = new File(_context.getConfigDir(), keyFile); + PrivateKeyFile pkf = new PrivateKeyFile(f); try { Destination d = pkf.getDestination(); if (d == null) @@ -87,8 +91,9 @@ public class EditBean extends IndexBean { SigningPrivateKey privKey = pkf.getSigningPrivKey(); if (privKey == null) return ""; - //System.err.println("Signing " + spoof + " with " + Base64.encode(privKey.getData())); Signature sig = _context.dsa().sign(spoof.getBytes("UTF-8"), privKey); + if (sig == null) + return ""; return Base64.encode(sig.getData()); } catch (I2PException e) { } catch (IOException e) {} diff --git a/apps/i2ptunnel/jsp/editServer.jsp b/apps/i2ptunnel/jsp/editServer.jsp index cc85904d32..77f7171743 100644 --- a/apps/i2ptunnel/jsp/editServer.jsp +++ b/apps/i2ptunnel/jsp/editServer.jsp @@ -226,26 +226,49 @@ input.default { width: 1px; height: 1px; visibility: hidden; } <%=intl._t("Local destination")%>(L): - <% String b64 = editBean.getDestinationBase64(curTunnel); - if (!"".equals(b64)) { - String name = editBean.getSpoofedHost(curTunnel); - if (name == null || name.equals("")) - name = editBean.getTunnelName(curTunnel); - if (!"".equals(name)) { %> - <%=intl._t("Add to local addressbook")%> - <% } - } %> <% if (("httpserver".equals(tunnelType)) || ("httpbidirserver".equals(tunnelType))) { + String sig = editBean.getNameSignature(curTunnel); + if (sig.length() > 0) { %>