forked from I2P_Developers/i2p.i2p
propagate from branch 'i2p.i2p.str4d.bench' (head 61fcef0f1004c55f7b15ba3982173050a952a08c)
to branch 'i2p.i2p' (head 8374318b8b49df7f47dfa0d2653413ceccab9b52) Core: New benchmarking framework based on JMH (ticket #2036)
This commit is contained in:
@@ -437,6 +437,8 @@ class IntelInfoImpl extends CPUIDCPUInfo implements IntelCPUInfo
|
||||
// See reference link errata #SKD052 re: BMI
|
||||
// ref: http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/desktop-6th-gen-core-family-spec-update.pdf
|
||||
// See Haswell notes above
|
||||
case 0x4e:
|
||||
case 0x55:
|
||||
case 0x5e: {
|
||||
CPUIDCPUInfo c = new CPUIDCPUInfo();
|
||||
if (c.hasAVX2() && c.hasBMI1() && c.hasBMI2() &&
|
||||
|
||||
@@ -18,7 +18,7 @@ public class CoreVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
|
||||
public final static String VERSION = "0.9.30";
|
||||
public final static String VERSION = "0.9.31";
|
||||
|
||||
/**
|
||||
* For Vuze.
|
||||
|
||||
@@ -599,10 +599,10 @@ public final class KeyStoreUtil {
|
||||
throw new IOException("Can't create directory " + dir);
|
||||
}
|
||||
Object[] rv = SelfSignedGenerator.generate(cname, ou, null, "I2P Anonymous Network", null, null, validDays, type);
|
||||
PublicKey jpub = (PublicKey) rv[0];
|
||||
//PublicKey jpub = (PublicKey) rv[0];
|
||||
PrivateKey jpriv = (PrivateKey) rv[1];
|
||||
X509Certificate cert = (X509Certificate) rv[2];
|
||||
X509CRL crl = (X509CRL) rv[3];
|
||||
//X509CRL crl = (X509CRL) rv[3];
|
||||
List<X509Certificate> certs = Collections.singletonList(cert);
|
||||
storePrivateKey(ks, ksPW, alias, keyPW, jpriv, certs);
|
||||
return rv;
|
||||
|
||||
@@ -713,7 +713,7 @@ public final class SelfSignedGenerator {
|
||||
|
||||
private static final void test(String name, SigType type) throws Exception {
|
||||
Object[] rv = generate("cname@example.com", "ou", "o", null, "st", "c", 3652, type);
|
||||
PublicKey jpub = (PublicKey) rv[0];
|
||||
//PublicKey jpub = (PublicKey) rv[0];
|
||||
PrivateKey jpriv = (PrivateKey) rv[1];
|
||||
X509Certificate cert = (X509Certificate) rv[2];
|
||||
X509CRL crl = (X509CRL) rv[3];
|
||||
|
||||
@@ -132,10 +132,20 @@ public class SigningPublicKey extends SimpleDataStructure {
|
||||
if (newType == null)
|
||||
return new SigningPublicKey(null, _data);
|
||||
int newLen = newType.getPubkeyLen();
|
||||
if (newLen == SigType.DSA_SHA1.getPubkeyLen())
|
||||
int ctype = kcert.getCryptoTypeCode();
|
||||
if (ctype == 0) {
|
||||
// prohibit excess key data
|
||||
// TODO non-zero crypto type if added
|
||||
int sz = 7;
|
||||
if (newLen > KEYSIZE_BYTES)
|
||||
sz += newLen - KEYSIZE_BYTES;
|
||||
if (kcert.size() != sz)
|
||||
throw new IllegalArgumentException("Excess data in key certificate");
|
||||
}
|
||||
if (newLen == KEYSIZE_BYTES)
|
||||
return new SigningPublicKey(newType, _data);
|
||||
byte[] newData = new byte[newLen];
|
||||
if (newLen < SigType.DSA_SHA1.getPubkeyLen()) {
|
||||
if (newLen < KEYSIZE_BYTES) {
|
||||
// right-justified
|
||||
System.arraycopy(_data, _data.length - newLen, newData, 0, newLen);
|
||||
} else {
|
||||
@@ -163,9 +173,9 @@ public class SigningPublicKey extends SimpleDataStructure {
|
||||
if (_type != SigType.DSA_SHA1)
|
||||
throw new IllegalStateException("Cannot convert " + _type + " to " + newType);
|
||||
int newLen = newType.getPubkeyLen();
|
||||
if (newLen >= SigType.DSA_SHA1.getPubkeyLen())
|
||||
if (newLen >= KEYSIZE_BYTES)
|
||||
return null;
|
||||
int padLen = SigType.DSA_SHA1.getPubkeyLen() - newLen;
|
||||
int padLen = KEYSIZE_BYTES - newLen;
|
||||
byte[] pad = new byte[padLen];
|
||||
System.arraycopy(_data, 0, pad, 0, padLen);
|
||||
return pad;
|
||||
|
||||
@@ -730,13 +730,13 @@ public class KBucketSet<T extends SimpleDataStructure> {
|
||||
public void getEntries(SelectionCollector<T> collector) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
public void clear() {}
|
||||
|
||||
public boolean add(T peer) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
public boolean remove(T peer) {
|
||||
return false;
|
||||
}
|
||||
@@ -765,6 +765,7 @@ public class KBucketSet<T extends SimpleDataStructure> {
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder buf = new StringBuilder(1024);
|
||||
buf.append("<div class=\"debug_container buckets\">");
|
||||
buf.append("<hr><b>Bucket set rooted on:</b> ").append(_us.toString())
|
||||
.append(" K=").append(BUCKET_SIZE)
|
||||
.append(" B=").append(B_VALUE)
|
||||
@@ -779,6 +780,7 @@ public class KBucketSet<T extends SimpleDataStructure> {
|
||||
buf.append(b.toString()).append("<br>\n");
|
||||
}
|
||||
} finally { releaseReadLock(); }
|
||||
buf.append("</div>");
|
||||
return buf.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1396,7 +1396,8 @@ public class EepGet {
|
||||
if ( /* (!_shouldProxy) && */
|
||||
// This is kindof a hack, but if we are downloading a gzip file
|
||||
// we don't want to transparently gunzip it and save it as a .gz file.
|
||||
(!path.endsWith(".gz")) && (!path.endsWith(".tgz")))
|
||||
path == null ||
|
||||
(!path.endsWith(".gz") && !path.endsWith(".tgz")))
|
||||
buf.append("gzip");
|
||||
buf.append("\r\n");
|
||||
if(!uaOverridden)
|
||||
|
||||
@@ -179,7 +179,7 @@ public class PortMapper {
|
||||
*/
|
||||
public void renderStatusHTML(Writer out) throws IOException {
|
||||
List<String> services = new ArrayList<String>(_dir.keySet());
|
||||
out.write("<h2>Port Mapper</h2><table><tr><th>Service<th>Host<th>Port\n");
|
||||
out.write("<h2 id=\"debug_portmapper\">Port Mapper</h2><table id=\"portmapper\"><tr><th>Service<th>Host<th>Port\n");
|
||||
Collections.sort(services);
|
||||
for (String s : services) {
|
||||
InetSocketAddress ia = _dir.get(s);
|
||||
|
||||
Reference in New Issue
Block a user