diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java index c09f226e1cd367d0bba294c33ccd3998f78ef0df..83c7fca4bb2aa049a7805210292fc0701e5ed3c6 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java @@ -504,6 +504,8 @@ public class GeneralHelper { /** * @param newTunnelType used if tunnel < 0 + * @return the current type if we have a destination already, + * else the default for that type of tunnel */ public int getSigType(int tunnel, String newTunnelType) { SigType type; 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 6e63732260d47511354e0f77695f136d6f03408d..bacd84aea8b59f73e0b6fd9bdee949c2ccda3255 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java @@ -23,6 +23,7 @@ import net.i2p.data.Signature; import net.i2p.data.SigningPrivateKey; import net.i2p.i2ptunnel.TunnelController; import net.i2p.i2ptunnel.TunnelControllerGroup; +import net.i2p.i2ptunnel.ui.GeneralHelper; import net.i2p.util.Addresses; /** @@ -222,7 +223,16 @@ public class EditBean extends IndexBean { public boolean isSigTypeAvailable(int code) { return SigType.isAvailable(code); } - + + /** @since 0.9.33 */ + public boolean canChangeSigType(int tunnel) { + if (tunnel < 0) + return true; + if (getDestination(tunnel) != null) + return false; + return getTunnelStatus(tunnel) == GeneralHelper.NOT_RUNNING; + } + /** * Random keys, hidden in forms * @since 0.9.18 diff --git a/apps/i2ptunnel/jsp/editClient.jsi b/apps/i2ptunnel/jsp/editClient.jsi index 8e5e92b5351a4a01af25b31de59c68d02b00d93b..88a9a897042e9f351c2bb3b7dabf00f39c475baf 100644 --- a/apps/i2ptunnel/jsp/editClient.jsi +++ b/apps/i2ptunnel/jsp/editClient.jsi @@ -116,7 +116,7 @@ <td> <b><%=intl._t("Reachable by")%>:</b> - <select id="reachableBy" name="reachableBy" title="<%=intl._t("Local interface (ip address) the client tunnel will be reachable from")%>" class="selectbox")%>"> + <select id="reachableBy" name="reachableBy" title="<%=intl._t("Local interface (ip address) the client tunnel will be reachable from")%>" class="selectbox"> <% String clientInterface = editBean.getClientInterface(curTunnel); for (String ifc : editBean.interfaceSet()) { @@ -544,24 +544,25 @@ <% if (true /* editBean.isAdvanced() */ ) { int currentSigType = editBean.getSigType(curTunnel, tunnelType); + String disabled = editBean.canChangeSigType(curTunnel) ? "" : " disabled=\"disabled\" "; %> <tr> <th colspan="2"> - <%=intl._t("Signature type")%> (<%=intl._t("Experts only!")%>) + <%=intl._t("Signature type")%> <%-- (<%=intl._t("Experts only!")%>) --%> </th> </tr> <tr> <td colspan="2"> <span class="multiOption"> - <label title="<%=intl._t("Legacy option (deprecated), provided for backward compatibility")%>"><input value="0" type="radio" name="sigType"<%=(currentSigType==0 ? " checked=\"checked\"" : "")%> class="tickbox" /> + <label title="<%=intl._t("Legacy option (deprecated), provided for backward compatibility")%>"><input value="0" type="radio" name="sigType" <%=disabled%> <%=(currentSigType==0 ? " checked=\"checked\"" : "")%> class="tickbox" /> DSA-SHA1</label> </span> <% if (editBean.isSigTypeAvailable(1)) { %> <span class="multiOption"> - <label><input value="1" type="radio" name="sigType"<%=(currentSigType==1 ? " checked=\"checked\"" : "")%> class="tickbox" /> + <label><input value="1" type="radio" name="sigType" <%=disabled%> <%=(currentSigType==1 ? " checked=\"checked\"" : "")%> class="tickbox" /> ECDSA-P256</label> </span> @@ -570,7 +571,7 @@ if (editBean.isSigTypeAvailable(2)) { %> <span class="multiOption"> - <label><input value="2" type="radio" name="sigType"<%=(currentSigType==2 ? " checked=\"checked\"" : "")%> class="tickbox" /> + <label><input value="2" type="radio" name="sigType" <%=disabled%> <%=(currentSigType==2 ? " checked=\"checked\"" : "")%> class="tickbox" /> ECDSA-P384</label> </span> @@ -578,7 +579,7 @@ if (editBean.isSigTypeAvailable(3)) { %> <span class="multiOption"> - <label><input value="3" type="radio" name="sigType"<%=(currentSigType==3 ? " checked=\"checked\"" : "")%> class="tickbox" /> + <label><input value="3" type="radio" name="sigType" <%=disabled%> <%=(currentSigType==3 ? " checked=\"checked\"" : "")%> class="tickbox" /> ECDSA-P521</label> </span> @@ -586,7 +587,7 @@ if (editBean.isSigTypeAvailable(7)) { %> <span class="multiOption"> - <label title="<%=intl._t("This is the default, recommended option")%>"><input value="7" type="radio" name="sigType"<%=(currentSigType==7 ? " checked=\"checked\"" : "")%> class="tickbox" /> + <label title="<%=intl._t("This is the default, recommended option")%>"><input value="7" type="radio" name="sigType" <%=disabled%> <%=(currentSigType==7 ? " checked=\"checked\"" : "")%> class="tickbox" /> Ed25519-SHA-512</label> </span> </td> diff --git a/apps/i2ptunnel/jsp/editServer.jsi b/apps/i2ptunnel/jsp/editServer.jsi index 1a0f5cb4c07e1fc8eda4852a8e27c88c7022aeca..e0aeb0ee7d9ca85138b6bca07f1aaece4d9b056e 100644 --- a/apps/i2ptunnel/jsp/editServer.jsi +++ b/apps/i2ptunnel/jsp/editServer.jsi @@ -792,39 +792,40 @@ <% int currentSigType = editBean.getSigType(curTunnel, tunnelType); if (true /* editBean.isAdvanced() */ ) { + String disabled = editBean.canChangeSigType(curTunnel) ? "" : " disabled=\"disabled\" "; %> <tr> <th colspan="2"> - <%=intl._t("Signature type")%> (<%=intl._t("Experts only! Changes B32!")%>) + <%=intl._t("Signature type")%> <%-- (<%=intl._t("Experts only! Changes B32!")%>) --%> </th> </tr> <tr> <td colspan="2"> <span class="multiOption"> - <label title="<%=intl._t("Legacy option (deprecated), provided for backward compatibility")%>"><input value="0" type="radio" id="startOnLoad" name="sigType"<%=(currentSigType==0 ? " checked=\"checked\"" : "")%> class="tickbox" /> + <label title="<%=intl._t("Legacy option (deprecated), provided for backward compatibility")%>"><input value="0" type="radio" id="startOnLoad" name="sigType" <%=disabled%> <%=(currentSigType==0 ? " checked=\"checked\"" : "")%> class="tickbox" /> DSA-SHA1</label> </span> <% if (editBean.isSigTypeAvailable(1)) { %> <span class="multiOption"> - <label><input value="1" type="radio" id="startOnLoad" name="sigType"<%=(currentSigType==1 ? " checked=\"checked\"" : "")%> class="tickbox" /> + <label><input value="1" type="radio" id="startOnLoad" name="sigType" <%=disabled%> <%=(currentSigType==1 ? " checked=\"checked\"" : "")%> class="tickbox" /> ECDSA-P256</label> </span> <% } if (editBean.isSigTypeAvailable(2)) { %> <span class="multiOption"> - <label><input value="2" type="radio" id="startOnLoad" name="sigType"<%=(currentSigType==2 ? " checked=\"checked\"" : "")%> class="tickbox" /> + <label><input value="2" type="radio" id="startOnLoad" name="sigType" <%=disabled%> <%=(currentSigType==2 ? " checked=\"checked\"" : "")%> class="tickbox" /> ECDSA-P384</label> </span> <% } if (editBean.isSigTypeAvailable(3)) { %> <span class="multiOption"> - <label><input value="3" type="radio" id="startOnLoad" name="sigType"<%=(currentSigType==3 ? " checked=\"checked\"" : "")%> class="tickbox" /> + <label><input value="3" type="radio" id="startOnLoad" name="sigType" <%=disabled%> <%=(currentSigType==3 ? " checked=\"checked\"" : "")%> class="tickbox" /> ECDSA-P521</label> </span> <% } if (editBean.isSigTypeAvailable(7)) { %> <span class="multiOption"> - <label title="<%=intl._t("This is the default, recommended option")%>"><input value="7" type="radio" id="startOnLoad" name="sigType"<%=(currentSigType==7 ? " checked=\"checked\"" : "")%> class="tickbox" /> + <label title="<%=intl._t("This is the default, recommended option")%>"><input value="7" type="radio" id="startOnLoad" name="sigType" <%=disabled%> <%=(currentSigType==7 ? " checked=\"checked\"" : "")%> class="tickbox" /> Ed25519-SHA-512</label> </span> <% } // isAvailable %> diff --git a/history.txt b/history.txt index e4b89638927059173c5e2fe1b2e187394afb0731..cf5fb47fd465985de0405315ef0e47b57f993498 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,10 @@ +2018-01-19 zzz + * i2ptunnel: Prevent changing sigtype after dest creation (ticket #2128) + +2018-01-18 zzz + * Build: New poupdate-source target + * Util: Consolidate console URL generation in PortMapper + 2018-01-17 zzz * i2ptunnel: - Set defaults for limits diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 9319fc01c919050d6e37a985b498a0942594c8e1..9535f12e9f688854edee123340f66844f29b31e9 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,10 +18,10 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 22; + public final static long BUILD = 23; /** for example "-test" */ - public final static String EXTRA = ""; + public final static String EXTRA = "-rc"; public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA; public static void main(String args[]) { System.out.println("I2P Router version: " + FULL_VERSION);