forked from I2P_Developers/i2p.i2p
NetDB: Mark ls2 received via garlic as blinded if bit 2 set in flags
This commit is contained in:
@ -952,7 +952,8 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad
|
|||||||
}
|
}
|
||||||
|
|
||||||
EncryptedLeaseSet encls = null;
|
EncryptedLeaseSet encls = null;
|
||||||
if (leaseSet.getType() == DatabaseEntry.KEY_TYPE_ENCRYPTED_LS2) {
|
int type = leaseSet.getType();
|
||||||
|
if (type == DatabaseEntry.KEY_TYPE_ENCRYPTED_LS2) {
|
||||||
// set dest or key before validate() calls verifySignature() which
|
// set dest or key before validate() calls verifySignature() which
|
||||||
// will do the decryption
|
// will do the decryption
|
||||||
encls = (EncryptedLeaseSet) leaseSet;
|
encls = (EncryptedLeaseSet) leaseSet;
|
||||||
@ -998,6 +999,14 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad
|
|||||||
store(dest.getHash(), decls);
|
store(dest.getHash(), decls);
|
||||||
_blindCache.setBlinded(dest);
|
_blindCache.setBlinded(dest);
|
||||||
}
|
}
|
||||||
|
} else if (type == DatabaseEntry.KEY_TYPE_LS2 || type == DatabaseEntry.KEY_TYPE_META_LS2) {
|
||||||
|
// if it came in via garlic
|
||||||
|
LeaseSet2 ls2 = (LeaseSet2) leaseSet;
|
||||||
|
if (ls2.isBlindedWhenPublished()) {
|
||||||
|
Destination dest = leaseSet.getDestination();
|
||||||
|
if (dest != null)
|
||||||
|
_blindCache.setBlinded(dest, null, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate through the old failure / success count, copying over the old
|
// Iterate through the old failure / success count, copying over the old
|
||||||
|
Reference in New Issue
Block a user