forked from I2P_Developers/i2p.i2p
i2ptunnel:
- Fix hostname signature not finding private key file - Hide hostname signature if not successful - Null check for hostname signature failure - Make add-to-addressbook link a button - Add QR code generation
This commit is contained in:
@ -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) {}
|
||||
|
@ -226,26 +226,49 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<%=intl._t("Local destination")%>(<span class="accessKey">L</span>):
|
||||
</label>
|
||||
<textarea rows="1" style="height: 3em;" cols="60" readonly="readonly" id="localDestination" title="Read Only: Local Destination (if known)" wrap="off" spellcheck="false"><%=editBean.getDestinationBase64(curTunnel)%></textarea>
|
||||
<% 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)) { %>
|
||||
<a href="/susidns/addressbook.jsp?book=private&hostname=<%=name%>&destination=<%=b64%>#add"><%=intl._t("Add to local addressbook")%></a>
|
||||
<% }
|
||||
} %>
|
||||
</div>
|
||||
|
||||
<% if (("httpserver".equals(tunnelType)) || ("httpbidirserver".equals(tunnelType))) {
|
||||
String sig = editBean.getNameSignature(curTunnel);
|
||||
if (sig.length() > 0) {
|
||||
%><div id="sigField" class="rowItem">
|
||||
<label for="signature">
|
||||
<%=intl._t("Hostname Signature")%>
|
||||
</label>
|
||||
<input type="text" size="30" readonly="readonly" title="Use to prove that the website name is for this destination" value="<%=editBean.getNameSignature(curTunnel)%>" wrap="off" class="freetext" />
|
||||
<input type="text" size="30" readonly="readonly" title="Use to prove that the website name is for this destination" value="<%=sig%>" wrap="off" class="freetext" />
|
||||
</div>
|
||||
<% } %>
|
||||
<%
|
||||
} // sig
|
||||
} // type
|
||||
|
||||
String b64 = editBean.getDestinationBase64(curTunnel);
|
||||
if (!"".equals(b64)) {
|
||||
%>
|
||||
<div id="destinationField" class="rowItem">
|
||||
<%
|
||||
b64 = b64.replace("=", "%3d");
|
||||
String name = editBean.getSpoofedHost(curTunnel);
|
||||
if (name == null || name.equals(""))
|
||||
name = editBean.getTunnelName(curTunnel);
|
||||
if (name != null && !name.equals("") && !name.contains(" ") && name.endsWith(".i2p")) {
|
||||
%>
|
||||
<label>
|
||||
<a class="control" title="<%=intl._t("Generate QR code")%>" href="/imagegen/qr?s=320&t=<%=name%>&c=http%3a%2f%2f<%=name%>%2f%3fi2paddresshelper%3d<%=b64%>" target="_top"><%=intl._t("Generate QR Code")%></a>
|
||||
</label>
|
||||
<a class="control" href="/susidns/addressbook.jsp?book=private&hostname=<%=name%>&destination=<%=b64%>#add"><%=intl._t("Add to local addressbook")%></a>
|
||||
<%
|
||||
} else {
|
||||
%>
|
||||
<label> </label>
|
||||
<span class="comment"><%=intl._t("Set name with .i2p suffix to enable QR code generation")%></span>
|
||||
<%
|
||||
} // name
|
||||
%>
|
||||
</div>
|
||||
<%
|
||||
} // b64
|
||||
|
||||
%>
|
||||
<div class="footer">
|
||||
</div>
|
||||
</div>
|
||||
|
13
history.txt
13
history.txt
@ -1,3 +1,14 @@
|
||||
2016-02-26 zzz
|
||||
* Console:
|
||||
- Add X-Content-Type-Options header everywhere (ticket #1763)
|
||||
- Don't display error after clicking restart on /graph page (ticket #1582)
|
||||
* i2ptunnel:
|
||||
- Fix default shouldBundleReplyInfo for non-HTTP servers
|
||||
- Fix display of hostname signature
|
||||
- Add QR code generation
|
||||
* Router: Log full path to wrapper.log when dumping threads
|
||||
* Transports: Increase connection limits for class N and higher
|
||||
|
||||
2016-02-22 zzz
|
||||
* Console: Improve news CSS (ticket #1710)
|
||||
* Crypto: Blacklist certificates by SHA1 hash, not by serial/CN/OU
|
||||
@ -327,7 +338,7 @@ Prop from i2p.i2p.zzz.test2:
|
||||
* SSU:
|
||||
- Support extended options
|
||||
- Add support for requesting a relay tag via
|
||||
Session Request extended options (ticket #1465)
|
||||
Session Request extended options (tickets #1465, #1656)
|
||||
* Tunnels:
|
||||
- Locking fixes
|
||||
- Don't set stats in our own profile
|
||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 8;
|
||||
public final static long BUILD = 9;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
|
Reference in New Issue
Block a user