forked from I2P_Developers/i2p.i2p
i2ptunnel: Prevent changing sigtype after dest creation (ticket #2128)
Fix HTML error in editClient
This commit is contained in:
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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 %>
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user