forked from I2P_Developers/i2p.i2p
Use "Base32" and "Base64" consistently in strings
Update clearnet user-agent to match TBB
This commit is contained in:
@ -92,7 +92,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
|
|||||||
"\r\n";
|
"\r\n";
|
||||||
// ESR version of Firefox, same as Tor Browser
|
// ESR version of Firefox, same as Tor Browser
|
||||||
private static final String UA_CLEARNET = "User-Agent: " +
|
private static final String UA_CLEARNET = "User-Agent: " +
|
||||||
"Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0" +
|
"Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0" +
|
||||||
"\r\n";
|
"\r\n";
|
||||||
// overrides
|
// overrides
|
||||||
private static final String PROP_UA_I2P = "httpclient.userAgent.i2p";
|
private static final String PROP_UA_I2P = "httpclient.userAgent.i2p";
|
||||||
@ -1221,7 +1221,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
|
|||||||
// 8-59 or 61-63 chars, this won't work
|
// 8-59 or 61-63 chars, this won't work
|
||||||
String header = getErrorPage("b32", ERR_DESTINATION_UNKNOWN);
|
String header = getErrorPage("b32", ERR_DESTINATION_UNKNOWN);
|
||||||
try {
|
try {
|
||||||
writeErrorMessage(header, _t("Corrupt b32 address"), out, targetRequest, false, destination);
|
writeErrorMessage(header, _t("Corrupt Base32 address"), out, targetRequest, false, destination);
|
||||||
} catch (IOException ioe) {}
|
} catch (IOException ioe) {}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1271,7 +1271,6 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
|
|||||||
// form to supply missing data
|
// form to supply missing data
|
||||||
writeB32SaveForm(out, destination, code, targetRequest);
|
writeB32SaveForm(out, destination, code, targetRequest);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
// fall through to standard destination unreachable error page
|
// fall through to standard destination unreachable error page
|
||||||
}
|
}
|
||||||
@ -1439,7 +1438,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
|
|||||||
"</td><td>" + destination + "</td></tr>\n");
|
"</td><td>" + destination + "</td></tr>\n");
|
||||||
try {
|
try {
|
||||||
String b32 = Base32.encode(SHA256Generator.getInstance().calculateHash(Base64.decode(ahelperKey)).getData());
|
String b32 = Base32.encode(SHA256Generator.getInstance().calculateHash(Base64.decode(ahelperKey)).getData());
|
||||||
out.write("<tr><td align=\"right\">" + _t("Base 32") + "</td>" +
|
out.write("<tr><td align=\"right\">" + _t("Base32") + "</td>" +
|
||||||
"<td><a href=\"http://" + b32 + ".b32.i2p/\">" + b32 + ".b32.i2p</a></td></tr>");
|
"<td><a href=\"http://" + b32 + ".b32.i2p/\">" + b32 + ".b32.i2p</a></td></tr>");
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
}
|
}
|
||||||
@ -1500,18 +1499,18 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
|
|||||||
String header = getErrorPage("b32-auth", ERR_DESTINATION_UNKNOWN);
|
String header = getErrorPage("b32-auth", ERR_DESTINATION_UNKNOWN);
|
||||||
out.write(header);
|
out.write(header);
|
||||||
out.write("<table id=\"proxyNewHost\">\n" +
|
out.write("<table id=\"proxyNewHost\">\n" +
|
||||||
"<tr><td align=\"right\">" + _t("Base 32") + "</td>" +
|
"<tr><td align=\"right\">" + _t("Base32") + "</td>" +
|
||||||
"<td>" + destination + "</td></tr>" +
|
"<td>" + destination + "</td></tr>" +
|
||||||
"\n</table>\n" + "<hr>");
|
"\n</table>\n" + "<hr>");
|
||||||
String msg;
|
String msg;
|
||||||
if (code == LookupResult.RESULT_SECRET_REQUIRED)
|
if (code == LookupResult.RESULT_SECRET_REQUIRED)
|
||||||
msg = _t("Base 32 address requires lookup password");
|
msg = _t("Base32 address requires lookup password");
|
||||||
else if (code == LookupResult.RESULT_KEY_REQUIRED)
|
else if (code == LookupResult.RESULT_KEY_REQUIRED)
|
||||||
msg = _t("Base 32 address requires encryption key");
|
msg = _t("Base32 address requires encryption key");
|
||||||
else if (code == LookupResult.RESULT_SECRET_AND_KEY_REQUIRED)
|
else if (code == LookupResult.RESULT_SECRET_AND_KEY_REQUIRED)
|
||||||
msg = _t("Base 32 address requires encryption key and lookup password");
|
msg = _t("Base32 address requires encryption key and lookup password");
|
||||||
else if (code == LookupResult.RESULT_DECRYPTION_FAILURE)
|
else if (code == LookupResult.RESULT_DECRYPTION_FAILURE)
|
||||||
msg = _t("Base 32 address decryption failure, check encryption key");
|
msg = _t("Base32 address decryption failure, check encryption key");
|
||||||
else
|
else
|
||||||
msg = "lookup failure code " + code;
|
msg = "lookup failure code " + code;
|
||||||
out.write("<p><b>" + msg + "</b></p>");
|
out.write("<p><b>" + msg + "</b></p>");
|
||||||
|
@ -453,7 +453,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<b><%=intl._t("Local Base 32")%>:</b>
|
<b><%=intl._t("Local Base32")%>:</b>
|
||||||
<%=editBean.getDestHashBase32(curTunnel)%>
|
<%=editBean.getDestHashBase32(curTunnel)%>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -520,11 +520,11 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
|||||||
} else {
|
} else {
|
||||||
valid = true;
|
valid = true;
|
||||||
%>
|
%>
|
||||||
<tr><td colspan="4"><b><%=intl._t("Base 32")%>:</b> <%=b32%></td></tr>
|
<tr><td colspan="4"><b><%=intl._t("Base32")%>:</b> <%=b32%></td></tr>
|
||||||
<%
|
<%
|
||||||
if (altb32 != null && altb32.length() > 0) {
|
if (altb32 != null && altb32.length() > 0) {
|
||||||
%>
|
%>
|
||||||
<tr><td><b><%=intl._t("Alt Base 32")%>:</b> <%=altb32%></td></tr>
|
<tr><td><b><%=intl._t("Alt Base32")%>:</b> <%=altb32%></td></tr>
|
||||||
<%
|
<%
|
||||||
} // altb32
|
} // altb32
|
||||||
final String CHECK = " ✔";
|
final String CHECK = " ✔";
|
||||||
|
@ -285,7 +285,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<%=intl._t("Type in the I2P destination of the service that this client tunnel should connect to.")%>
|
<%=intl._t("Type in the I2P destination of the service that this client tunnel should connect to.")%>
|
||||||
<%=intl._t("This could be the full base 64 destination key, or an I2P URL from your address book.")%>
|
<%=intl._t("This could be the full Base64 destination key, or an I2P URL from your address book.")%>
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -84,7 +84,7 @@ public class ConfigKeyringHandler extends FormHandler {
|
|||||||
spk = bdin.getUnblindedPubKey();
|
spk = bdin.getUnblindedPubKey();
|
||||||
}
|
}
|
||||||
if (spk == null) {
|
if (spk == null) {
|
||||||
addFormError(_t("Requires hostname, destination, or blinded base32"));
|
addFormError(_t("Requires hostname, destination, or blinded Base32"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// from BlindCache
|
// from BlindCache
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
<% } %>
|
<% } %>
|
||||||
</td>
|
</td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td align="right"><b><%=intl._t("Full destination, name, base 32, or hash")%>:</b></td>
|
<td align="right"><b><%=intl._t("Full destination, name, Base32, or hash")%>:</b></td>
|
||||||
<td><input type="text" name="peer" size="55"></td>
|
<td><input type="text" name="peer" size="55"></td>
|
||||||
</tr><tr>
|
</tr><tr>
|
||||||
<td align="right"><b><%=intl._t("Type")%>:</b></td>
|
<td align="right"><b><%=intl._t("Type")%>:</b></td>
|
||||||
|
@ -19,7 +19,7 @@ Proxy-Connection: close
|
|||||||
<div class="warning" id="warning">
|
<div class="warning" id="warning">
|
||||||
<h3>_("Warning: Invalid Destination")</h3>
|
<h3>_("Warning: Invalid Destination")</h3>
|
||||||
<p>
|
<p>
|
||||||
_("The b32 address is invalid.")
|
_("The Base32 address is invalid.")
|
||||||
<hr>
|
<hr>
|
||||||
<p><b>_("Could not find the following destination:")</b>
|
<p><b>_("Could not find the following destination:")</b>
|
||||||
</p>
|
</p>
|
||||||
|
Reference in New Issue
Block a user