Activate outgoing keys when incoming tag is recognised.

This commit is contained in:
akwizgran
2018-03-28 12:26:12 +01:00
parent f7c2f86499
commit b81058d6da
2 changed files with 102 additions and 26 deletions

View File

@@ -355,6 +355,16 @@ class TransportKeyManagerImpl implements TransportKeyManager {
db.setReorderingWindow(txn, tagCtx.keySetId, transportId,
inKeys.getRotationPeriod(), window.getBase(),
window.getBitmap());
// If the outgoing keys are inactive, activate them
MutableKeySet ks = keys.get(tagCtx.keySetId);
MutableOutgoingKeys outKeys =
ks.getTransportKeys().getCurrentOutgoingKeys();
if (!outKeys.isActive()) {
LOG.info("Activating outgoing keys");
outKeys.activate();
considerReplacingOutgoingKeys(ks);
db.setTransportKeysActive(txn, transportId, tagCtx.keySetId);
}
return ctx;
} finally {
lock.unlock();