-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move key handling to tang itself #53
Move key handling to tang itself #53
Conversation
Not looking good on armhf, possibly still a race
Will check further and report. |
Not looking good on armhf. Test suite fails
Will check further, stay tuned. |
A couple of tests are expected to return 404. Try to increase the timeout in |
We currently rely on the tangd-update script to read the keys and generate signed advertisements as well as JWKs for key derivation. Whenever there is a change in the directory containing the actual keys, we run tangd-update through a systemd file watching mechanism, so that we can have a cache directory with updated advertisements + JWKs. As reported in latchset#23 and latchset#24, this mechanism can be unreliable in certain situations, and having up-to-date information on the keys that are available is critical to tang, so the idea here is to remove this dependency on external scripts (e.g. tangd-update) and move this computation to tang itself. In this commit we add the related functions for key manipulation so that in a next step we can start using it in tang.
In this commit we add tests for the key manipulation functions added in src/keys.{c|h}.
39ae3ea
to
5bed056
Compare
@cbiedl: could you try this updated version, please? |
Use the key manipulation functions added in src/keys.{c|h} in tangd. This effectively removes the need for a cache directory -- usually /var/cache/tang --, which contained pre-computed files with signed advertisements and JWK with keys for deriving new keys. This computation was done by the tangd-update script, which has also been removed in this commit. We relied on systemd to run this script whenever the JWK dir -- usually /var/db/tang, which is where the actual keys are located -- changed, to keep the cache directory updated, but this is sometimes unreliable, causing issues like the ones reported in latchset#23 and latchset#24. As of now, tang performs these computations itself and does not depend on external scripts to make sure it has reliable information regarding its keys. Additionally, tang also creates a new pair of keys if none exist.
5bed056
to
c0f080e
Compare
Looks fine here, build passes on armhf, requesting an advertisement works as expected. One thing in the sources, though: |
Thanks for testing.
Good point. Looking into |
Just as a follow/heads-up:
Did you actually do this, @sergio-correia? I've checked your recent PRs and they all seem to be about something different. |
Not yet. |
This effectively removes the cache directory -- usually /var/cache/tang
--, which had pre-computed files with signed advertisements and JWK with
keys for deriving new keys.
This computation was done by the tangd-update script, which has also
been removed in this commit.
We relied on systemd to run this script whenever the JWK dir -- usually
/var/db/tang, which is where the actual keys are located -- changed, to
keep the cache directory updated, but this is sometimes unreliable,
causing issues like the ones reported in #23 and #24.
As of now, tang performs these computations itself and does not depend
on external scripts to make sure it has reliable information regarding
its keys.
Tests added as well.
Resolves: #23
Resolves: #24