forked from I2P_Developers/i2p.i2p
* I2CP Client: Generate revocation key of same type as signing key
* i2ptunnel: Only offer Sig options that are available in the JVM * LeaseSet: Add check for SigTYpe mismatch * SigType: Add isAvailable()
This commit is contained in:
@@ -15,6 +15,7 @@ import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import net.i2p.client.I2PClient;
|
||||
import net.i2p.crypto.SigType;
|
||||
import net.i2p.data.Base64;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.data.PrivateKeyFile;
|
||||
@@ -183,6 +184,12 @@ public class EditBean extends IndexBean {
|
||||
return getProperty(tunnel, I2PClient.PROP_SIGTYPE, 0);
|
||||
}
|
||||
|
||||
/** @since 0.9.12 */
|
||||
public boolean isSigTypeAvailable(int code) {
|
||||
SigType type = SigType.getByCode(code);
|
||||
return type != null && type.isAvailable();
|
||||
}
|
||||
|
||||
/** @since 0.8.9 */
|
||||
public boolean getDCC(int tunnel) {
|
||||
return getBooleanProperty(tunnel, I2PTunnelIRCClient.PROP_DCC);
|
||||
|
@@ -461,18 +461,24 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<label>DSA-SHA1</label>
|
||||
<input value="0" type="radio" id="startOnLoad" name="sigType" title="Default"<%=(editBean.getSigType(curTunnel)==0 ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<% if (editBean.isSigTypeAvailable(1)) { %>
|
||||
<div id="portField" class="rowItem">
|
||||
<label>ECDSA-P256</label>
|
||||
<input value="1" type="radio" id="startOnLoad" name="sigType" title="Advanced users only"<%=(editBean.getSigType(curTunnel)==1 ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<% }
|
||||
if (editBean.isSigTypeAvailable(2)) { %>
|
||||
<div id="portField" class="rowItem">
|
||||
<label>ECDSA-P384</label>
|
||||
<input value="2" type="radio" id="startOnLoad" name="sigType" title="Advanced users only"<%=(editBean.getSigType(curTunnel)==2 ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<% }
|
||||
if (editBean.isSigTypeAvailable(3)) { %>
|
||||
<div id="portField" class="rowItem">
|
||||
<label>ECDSA-P521</label>
|
||||
<input value="3" type="radio" id="startOnLoad" name="sigType" title="Advanced users only"<%=(editBean.getSigType(curTunnel)==3 ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<% } // isAvailable %>
|
||||
</div>
|
||||
|
||||
<div class="subdivider">
|
||||
|
@@ -563,18 +563,24 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<label>DSA-SHA1</label>
|
||||
<input value="0" type="radio" id="startOnLoad" name="sigType" title="Default"<%=(editBean.getSigType(curTunnel)==0 ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<% if (editBean.isSigTypeAvailable(1)) { %>
|
||||
<div id="portField" class="rowItem">
|
||||
<label>ECDSA-P256</label>
|
||||
<input value="1" type="radio" id="startOnLoad" name="sigType" title="Advanced users only"<%=(editBean.getSigType(curTunnel)==1 ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<% }
|
||||
if (editBean.isSigTypeAvailable(2)) { %>
|
||||
<div id="portField" class="rowItem">
|
||||
<label>ECDSA-P384</label>
|
||||
<input value="2" type="radio" id="startOnLoad" name="sigType" title="Advanced users only"<%=(editBean.getSigType(curTunnel)==2 ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<% }
|
||||
if (editBean.isSigTypeAvailable(3)) { %>
|
||||
<div id="portField" class="rowItem">
|
||||
<label>ECDSA-P521</label>
|
||||
<input value="3" type="radio" id="startOnLoad" name="sigType" title="Advanced users only"<%=(editBean.getSigType(curTunnel)==3 ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<% } // isAvailable %>
|
||||
</div>
|
||||
|
||||
<div class="subdivider">
|
||||
|
Reference in New Issue
Block a user