Changeset b3f37db3


Ignore:
Timestamp:
Feb 26, 2016 3:25:01 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
d28f983c
Parents:
5f7d636
Message:

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
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java

    r5f7d636 rb3f37db3  
    99 */
    1010
     11import java.io.File;
    1112import java.io.IOException;
    1213import java.util.List;
     
    8081        String keyFile = tun.getPrivKeyFile();
    8182        if (keyFile != null && keyFile.trim().length() > 0) {
    82             PrivateKeyFile pkf = new PrivateKeyFile(keyFile);
     83            File f = new File(keyFile);
     84            if (!f.isAbsolute())
     85                f = new File(_context.getConfigDir(), keyFile);
     86            PrivateKeyFile pkf = new PrivateKeyFile(f);
    8387            try {
    8488                Destination d = pkf.getDestination();
     
    8892                if (privKey == null)
    8993                    return "";
    90                 //System.err.println("Signing " + spoof + " with " + Base64.encode(privKey.getData()));
    9194                Signature sig = _context.dsa().sign(spoof.getBytes("UTF-8"), privKey);
     95                if (sig == null)
     96                    return "";
    9297                return Base64.encode(sig.getData());
    9398            } catch (I2PException e) {
  • apps/i2ptunnel/jsp/editServer.jsp

    r5f7d636 rb3f37db3  
    227227                </label>
    228228                <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>               
    229          <% String b64 = editBean.getDestinationBase64(curTunnel);
     229            </div>
     230
     231            <% if (("httpserver".equals(tunnelType)) || ("httpbidirserver".equals(tunnelType))) {
     232                   String sig = editBean.getNameSignature(curTunnel);
     233                   if (sig.length() > 0) {
     234          %><div id="sigField" class="rowItem">
     235                <label for="signature">
     236                    <%=intl._t("Hostname Signature")%>
     237                </label>
     238                <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" />               
     239            </div>
     240         <%
     241                   }  // sig
     242               }  // type
     243
     244            String b64 = editBean.getDestinationBase64(curTunnel);
    230245            if (!"".equals(b64)) {
     246         %>
     247            <div id="destinationField" class="rowItem">
     248        <%
     249                b64 = b64.replace("=", "%3d");
    231250                String name = editBean.getSpoofedHost(curTunnel);
    232251                if (name == null || name.equals(""))
    233252                    name = editBean.getTunnelName(curTunnel);
    234                 if (!"".equals(name)) { %>
    235                     <a href="/susidns/addressbook.jsp?book=private&amp;hostname=<%=name%>&amp;destination=<%=b64%>#add"><%=intl._t("Add to local addressbook")%></a>   
    236          <%     }
    237             } %>
    238             </div>
    239 
    240             <% if (("httpserver".equals(tunnelType)) || ("httpbidirserver".equals(tunnelType))) {
    241           %><div id="sigField" class="rowItem">
    242                 <label for="signature">
    243                     <%=intl._t("Hostname Signature")%>
    244                 </label>
    245                 <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" />               
    246             </div>
    247             <% } %>
    248 
     253                if (name != null && !name.equals("") && !name.contains(" ") && name.endsWith(".i2p")) {
     254         %>
     255              <label>
     256              <a class="control" title="<%=intl._t("Generate QR code")%>" href="/imagegen/qr?s=320&amp;t=<%=name%>&amp;c=http%3a%2f%2f<%=name%>%2f%3fi2paddresshelper%3d<%=b64%>" target="_top"><%=intl._t("Generate QR Code")%></a>
     257              </label>
     258              <a class="control" href="/susidns/addressbook.jsp?book=private&amp;hostname=<%=name%>&amp;destination=<%=b64%>#add"><%=intl._t("Add to local addressbook")%></a>   
     259        <%
     260                } else {
     261          %>
     262              <label> </label>
     263              <span class="comment"><%=intl._t("Set name with .i2p suffix to enable QR code generation")%></span>
     264        <%
     265                }  // name
     266         %>
     267            </div>
     268        <%
     269            }  // b64
     270
     271         %>
    249272            <div class="footer">
    250273            </div>
  • history.txt

    r5f7d636 rb3f37db3  
     12016-02-26 zzz
     2 * Console:
     3   - Add X-Content-Type-Options header everywhere (ticket #1763)
     4   - Don't display error after clicking restart on /graph page (ticket #1582)
     5 * i2ptunnel:
     6   - Fix default shouldBundleReplyInfo for non-HTTP servers
     7   - Fix display of hostname signature
     8   - Add QR code generation
     9 * Router: Log full path to wrapper.log when dumping threads
     10 * Transports: Increase connection limits for class N and higher
     11
    1122016-02-22 zzz
    213 * Console: Improve news CSS (ticket #1710)
     
    328339   - Support extended options
    329340   - Add support for requesting a relay tag via
    330      Session Request extended options (ticket #1465)
     341     Session Request extended options (tickets #1465, #1656)
    331342 * Tunnels:
    332343   - Locking fixes
  • router/java/src/net/i2p/router/RouterVersion.java

    r5f7d636 rb3f37db3  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 8;
     21    public final static long BUILD = 9;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.