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

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

View File

@ -602,12 +602,12 @@ class ClientConnectionRunner {
hasElg = true;
}
if (hasElg) {
TransientSessionKeyManager tskm = new TransientSessionKeyManager(_context, tags, thresh);
if (hasEC) {
TransientSessionKeyManager tskm = new TransientSessionKeyManager(_context, tags, thresh);
RatchetSKM rskm = new RatchetSKM(_context);
_sessionKeyManager = new MuxedSKM(tskm, rskm);
} else {
_sessionKeyManager = new TransientSessionKeyManager(_context, tags, thresh);
_sessionKeyManager = tskm;
}
} else {
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.
* If this is not the case, override in the extending class.
* We assume the data has enough randomness in it, so use 4 bytes for speed.
*/
@Override
public int hashCode() {
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
public boolean equals(Object obj) {
if (obj == this) return true;