From 69638caa7b42bd63c0b134cb927ba9c0cd8a0cbd Mon Sep 17 00:00:00 2001 From: zzz Date: Tue, 17 Sep 2019 13:18:47 +0000 Subject: [PATCH] i2ptunnel: B32 auth form improvements --- .../i2p/i2ptunnel/I2PTunnelHTTPClient.java | 33 +++++++++++-------- installer/resources/proxy/b32-auth-header.ht | 23 +++++++++++++ 2 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 installer/resources/proxy/b32-auth-header.ht diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java index 63df4acce..88d6a11be 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java @@ -1497,22 +1497,21 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn if(outs == null) return; Writer out = new BufferedWriter(new OutputStreamWriter(outs, "UTF-8")); - String header = getErrorPage("b32", ERR_DESTINATION_UNKNOWN); + String header = getErrorPage("b32-auth", ERR_DESTINATION_UNKNOWN); out.write(header); - out.write("\n\n"); - out.write("" + - ""); - out.write("\n
" + _t("Host") + - "" + destination + "
" + _t("Base 32") + "" + destination + "
\n" + "
"); + out.write("\n" + + "" + + "" + + "\n
" + _t("Base 32") + "" + destination + "
\n" + "
"); String msg; if (code == LookupResult.RESULT_SECRET_REQUIRED) - msg = _t("b32 address requires lookup password"); + msg = _t("Base 32 address requires lookup password"); else if (code == LookupResult.RESULT_KEY_REQUIRED) - msg = _t("b32 address requires encryption key"); + msg = _t("Base 32 address requires encryption key"); else if (code == LookupResult.RESULT_SECRET_AND_KEY_REQUIRED) - msg = _t("b32 address requires encryption key and lookup password"); + msg = _t("Base 32 address requires encryption key and lookup password"); else if (code == LookupResult.RESULT_DECRYPTION_FAILURE) - msg = _t("b32 address decryption failure, check encryption key"); + msg = _t("Base 32 address decryption failure, check encryption key"); else msg = "lookup failure code " + code; out.write("

" + msg + "

"); @@ -1529,20 +1528,26 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn ' ' + _t("Ask the server operator for help.") + "

\n" + - "

\n" + + "

" + _t("Enter PSK encryption key") + + "

\n" + + "\n" + "

" + _t("Generate new DH encryption key") + - "\n"); + "

" + + "
\n"); //"

" + _t("Generate new PSK encryption key") + //"\n"); } if (code == LookupResult.RESULT_SECRET_REQUIRED || code == LookupResult.RESULT_SECRET_AND_KEY_REQUIRED) { out.write("

" + _t("Lookup password") + "

\n

" + - "

\n"); + "

" + _t("You must enter the password provided by the server operator.") + + "

\n" + + "\n"); } // FIXME wasn't escaped String label = _t("Save & continue").replace("&", "&"); - out.write("
\n" + "\n\n"); writeFooter(out); diff --git a/installer/resources/proxy/b32-auth-header.ht b/installer/resources/proxy/b32-auth-header.ht new file mode 100644 index 000000000..c6f416d6f --- /dev/null +++ b/installer/resources/proxy/b32-auth-header.ht @@ -0,0 +1,23 @@ +HTTP/1.1 400 Destination Not Found +Content-Type: text/html; charset=UTF-8 +Cache-Control: no-cache +Connection: close +Proxy-Connection: close + + + +_("Website Unreachable") + + + + + + +
+

_("Warning: Authorization Required")

+

+

_("Could not find the following destination:") +