Skip to content
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

WIP: GPG remote trusted key updating #2260

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Commits on Oct 18, 2019

  1. lib/repo: Factor out GPG verifier key imports

    Currently the verifier only imports all the GPG keys when verifying
    data, but it would also be useful for inspecting the trusted keys.
    dbnicholson committed Oct 18, 2019
    Configuration menu
    Copy the full SHA
    e9a0ebb View commit details
    Browse the repository at this point in the history
  2. lib/repo: Factor out GPG verifier preparation

    In order to use the GPG verifier, it needs to be seeded with GPG keys
    after instantation. Currently this is only used for verifying data, but
    it will also be used for getting a list of trusted GPG keys in a
    subsequent commit.
    dbnicholson committed Oct 18, 2019
    Configuration menu
    Copy the full SHA
    dff3c24 View commit details
    Browse the repository at this point in the history
  3. lib/repo: Add ostree_repo_remote_get_gpg_keys()

    This function enumerates the trusted GPG keys for a remote and returns
    an array of `GVariant`s describing them. This is useful to see which
    keys are collected by ostree for a particular remote. The same
    information can be gathered with `gpg`. However, since ostree allows
    multiple keyring locations, that's only really useful if you have
    knowledge of how ostree collects GPG keyrings.
    
    The format of the variants is documented in
    `OSTREE_GPG_KEY_GVARIANT_FORMAT`. This format is primarily a copy of
    selected fields within `gpgme_key_t` and its subtypes. The fields are
    placed within vardicts rather than using a more efficient tuple of
    concrete types. This will allow flexibility if more components of
    `gpgme_key_t` are desired in the future.
    dbnicholson committed Oct 18, 2019
    Configuration menu
    Copy the full SHA
    7397b18 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2019

  1. bin/remote: Add list-gpg-keys subcommand

    This provides a wrapper for the `ostree_repo_remote_get_gpg_keys`
    function to show the GPG keys associated with a remote. This is
    particularly useful for validating the GPG key updates have been
    applied.
    dbnicholson committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    a122429 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    655f738 View commit details
    Browse the repository at this point in the history
  3. libotutil: Import implementation of zbase32 encoding

    This will be used to implement the PGP Web Key Directory (WKD) URL
    generation. This is a slightly cleaned up implementation[1] taken from
    the zbase32 author's original implementation[2]. It provides a single
    zbase32_encode API to convert a set of bytes to the zbase32 encoding.
    
    I believe this should be acceptable for inclusion in ostree. The license
    in the source files is BSD style while the original repo LICENSE file
    claims the Creative Commons CC0 1.0 Universal license, which is public
    domain.
    
    1. https://github.com/dbnicholson/libbase32/tree/for-ostree
    2. https://github.com/zooko/libbase32
    dbnicholson committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    da1b903 View commit details
    Browse the repository at this point in the history
  4. libotutil: Add helper for GPG WKD update URLs

    Calculate the advanced and direct update URLs for the key discovery
    portion[1] of the OpenPGP Web Key Directory specification, and include
    the URLs in the key listing in ostree_repo_remote_get_gpg_keys(). These
    URLs can be used to locate updated GPG keys for the remote.
    
    1. https://tools.ietf.org/html/draft-koch-openpgp-webkey-service-08#section-3.1
    dbnicholson committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    e807714 View commit details
    Browse the repository at this point in the history
  5. lib/repo: Include WKD update URLs in GPG key listing

    If the key UID contains a valid email address, include the GPG WKD
    update URLs in GVariant returned by ostree_repo_remote_get_gpg_keys().
    dbnicholson committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    6e05583 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    932a556 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7bac5b8 View commit details
    Browse the repository at this point in the history
  8. wip GPG key update API

    dbnicholson committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    0f5d5ee View commit details
    Browse the repository at this point in the history
  9. bin/remote: Add update-gpg-keys subcommand

    This provides a wrapper for the `ostree_repo_remote_update_gpg_keys` API
    to update a remote's GPG trusted keys using the PGP Web Key Directory
    protocol.
    dbnicholson committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    2cf3985 View commit details
    Browse the repository at this point in the history
  10. lib/gpg: Allow local server override for WKD URLs

    In order to test `ostree_remote_update_gpg_keys`, we need to be able to
    fetch the keys from a local test server. This inherently requires
    introducing a backdoor to the update process. If the
    _OSTREE_GPG_UPDATE_LOCAL_PORT environment variable is set, change the
    server to http://127.0.0.1:<port> after validating that the port is
    numerical. This should keep any attack local by not allowing the URL to
    be changed to an arbitrary remote server.
    dbnicholson committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    7a9aca9 View commit details
    Browse the repository at this point in the history
  11. tests for update-gpg-keys

    dbnicholson committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    27202db View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2019

  1. Configuration menu
    Copy the full SHA
    6d46edf View commit details
    Browse the repository at this point in the history