Skip to content
Snippets Groups Projects
Commit 2621ab01 authored by akwizgran's avatar akwizgran
Browse files

Merge branch '55-key-manager-refactoring' into 'master'

Refactor KeyManager and TagRecogniser, implement new key rotation logic.

This patch implements the new key rotation logic for BTP version 2, the new transport protocol (#111).

KeyManager and TagRecogniser have been merged (#55). They no longer need to hold locks while calling each other's methods (#3, #4). TransportKeyManager holds a lock while calling CryptoComponent methods, but those methods don't block or acquire any locks.

The maximum clock difference has been increased from one hour to 24 hours because some people adjust the time rather than the timezone when travelling (#18). This will cause keys to be rotated less frequently.

For the same reason, the key manager no longer throws an Error when the clock moves backwards - keys that belong to future rotation periods are kept until they become current, then rotation resumes (#19).

The new KeyManagerImpl and TransportKeyManager need unit tests. I'm putting this up for review while I write the tests.

TransportKeyManager needs further work before #55 is complete - when a stream context is created, TransportKeyManager should wait for the database write to complete before returning the context, to avoid the risk of key reuse if the write fails. I'll make a separate patch for that as this one's big enough already.

Enjoy!

See merge request !13
parents 1f8e86c0 6dc225d0
Loading
Showing
with 401 additions and 346 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment