misc. minor cleanups

This commit is contained in:
zzz
2019-12-02 15:21:46 +00:00
parent 11d89e248e
commit cc3c2d4d1a
4 changed files with 7 additions and 11 deletions

View File

@ -131,7 +131,7 @@
### Build and test ### Build and test
1. `ant release` 1. `ant release` or `ant releaseWithGeoIP` or `ant releaseWithJbigi`
- Copy i2pinstall_${release.number}_windows.exe, - Copy i2pinstall_${release.number}_windows.exe,
console.ico, ../lib/izpack/rh.bat, and ../lib/izpack/VersionInfo_template.rc console.ico, ../lib/izpack/rh.bat, and ../lib/izpack/VersionInfo_template.rc

View File

@ -62,10 +62,12 @@ public class LeaseSetKeys {
* *
* @param dest unused * @param dest unused
* @param revocationKey unused, may be null * @param revocationKey unused, may be null
* @param decryptionKeys non-null * @param decryptionKeys non-null, non-empty
* @since 0.9.44 * @since 0.9.44
*/ */
public LeaseSetKeys(Destination dest, SigningPrivateKey revocationKey, List<PrivateKey> decryptionKeys) { public LeaseSetKeys(Destination dest, SigningPrivateKey revocationKey, List<PrivateKey> decryptionKeys) {
if (decryptionKeys.isEmpty())
throw new IllegalArgumentException("no keys");
_revocationKey = revocationKey; _revocationKey = revocationKey;
PrivateKey elg = null; PrivateKey elg = null;
PrivateKey ec = null; PrivateKey ec = null;

View File

@ -602,12 +602,12 @@ class ClientConnectionRunner {
hasElg = true; hasElg = true;
} }
if (hasElg) { if (hasElg) {
TransientSessionKeyManager tskm = new TransientSessionKeyManager(_context, tags, thresh);
if (hasEC) { if (hasEC) {
TransientSessionKeyManager tskm = new TransientSessionKeyManager(_context, tags, thresh);
RatchetSKM rskm = new RatchetSKM(_context); RatchetSKM rskm = new RatchetSKM(_context);
_sessionKeyManager = new MuxedSKM(tskm, rskm); _sessionKeyManager = new MuxedSKM(tskm, rskm);
} else { } else {
_sessionKeyManager = new TransientSessionKeyManager(_context, tags, thresh); _sessionKeyManager = tskm;
} }
} else { } else {
if (hasEC) { if (hasEC) {

View File

@ -40,19 +40,13 @@ public class RatchetSessionTag {
} }
/** /**
* We assume the data has enough randomness in it, so use the first 4 bytes for speed. * We assume the data has enough randomness in it, so use 4 bytes for speed.
* If this is not the case, override in the extending class.
*/ */
@Override @Override
public int hashCode() { public int hashCode() {
return (int) _data; return (int) _data;
} }
/**
* Warning - this returns true for two different classes with the same size
* and same data, e.g. SessionKey and SessionTag, but you wouldn't
* put them in the same Set, would you?
*/
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == this) return true; if (obj == this) return true;