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 c09f226e1c..83c7fca4bb 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 6e63732260..bacd84aea8 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 8e5e92b535..88a9a89704 100644 --- a/apps/i2ptunnel/jsp/editClient.jsi +++ b/apps/i2ptunnel/jsp/editClient.jsi @@ -116,7 +116,7 @@ <%=intl._t("Reachable by")%>: - " 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\" "; %> - <%=intl._t("Signature type")%> (<%=intl._t("Experts only!")%>) + <%=intl._t("Signature type")%> <%-- (<%=intl._t("Experts only!")%>) --%> - <% if (editBean.isSigTypeAvailable(1)) { %> - @@ -570,7 +571,7 @@ if (editBean.isSigTypeAvailable(2)) { %> - @@ -578,7 +579,7 @@ if (editBean.isSigTypeAvailable(3)) { %> - @@ -586,7 +587,7 @@ if (editBean.isSigTypeAvailable(7)) { %> - diff --git a/apps/i2ptunnel/jsp/editServer.jsi b/apps/i2ptunnel/jsp/editServer.jsi index 1a0f5cb4c0..e0aeb0ee7d 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\" "; %> - <%=intl._t("Signature type")%> (<%=intl._t("Experts only! Changes B32!")%>) + <%=intl._t("Signature type")%> <%-- (<%=intl._t("Experts only! Changes B32!")%>) --%> - <% if (editBean.isSigTypeAvailable(1)) { %> - <% } if (editBean.isSigTypeAvailable(2)) { %> - <% } if (editBean.isSigTypeAvailable(3)) { %> - <% } if (editBean.isSigTypeAvailable(7)) { %> - <% } // isAvailable %> diff --git a/history.txt b/history.txt index e4b8963892..cf5fb47fd4 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 9319fc01c9..9535f12e9f 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);