mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 20:59:54 +01:00
Added sanity checks to catch bugs like #190.
This commit is contained in:
@@ -11,6 +11,12 @@ public class TransportKeys {
|
|||||||
|
|
||||||
public TransportKeys(TransportId transportId, IncomingKeys inPrev,
|
public TransportKeys(TransportId transportId, IncomingKeys inPrev,
|
||||||
IncomingKeys inCurr, IncomingKeys inNext, OutgoingKeys outCurr) {
|
IncomingKeys inCurr, IncomingKeys inNext, OutgoingKeys outCurr) {
|
||||||
|
if (inPrev.getRotationPeriod() != inCurr.getRotationPeriod() - 1)
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
if (inNext.getRotationPeriod() != inCurr.getRotationPeriod() + 1)
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
if (outCurr.getRotationPeriod() != inCurr.getRotationPeriod())
|
||||||
|
throw new IllegalArgumentException();
|
||||||
this.transportId = transportId;
|
this.transportId = transportId;
|
||||||
this.inPrev = inPrev;
|
this.inPrev = inPrev;
|
||||||
this.inCurr = inCurr;
|
this.inCurr = inCurr;
|
||||||
|
|||||||
Reference in New Issue
Block a user