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

bin/xbps-install: add --import-key arg for non-interactive key import #568

Closed

Commits on Aug 11, 2023

  1. lib/repo.c: add expected fingerprints argument to xbps_repo_key_import

    this array is a list of key fingerprints that should be imported without
    confirmation upon importing keys for a signed repository. A new state_cb
    state is added to allow for showing a message or doing some action when
    importing these keys.
    classabbyamp committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    5180b02 View commit details
    Browse the repository at this point in the history
  2. bin/xbps-install: add --import-key arg for non-interactive key import

    Allows the user to specify a list of key fingerprints that are expected
    and should be imported if encountered. This will be useful for scripted
    or other non-interactive situations, including in xbps-src (removing
    interaction during operations if the repodata in hostdir/binpkgs is signed),
    and bootstrapping new systems without needing to copy the <fingerprint>.plist
    files into place beforehand.
    
    Prints a message when importing to ensure the user knows the key was imported:
    
    ```
    [*] Updating repository `http://localhost:8000//x86_64-repodata' ...
    x86_64-repodata: 2098B [avg rate: 500MB/s]
    [*] Updating repository `https://repo-fastly.voidlinux.org/current/x86_64-repodata' ...
    x86_64-repodata: 1849KB [avg rate: 597MB/s]
    `http://localhost:8000/' repository has been RSA signed by "classabbyamp"
    Importing key with fingerprint: 6e:a5:91:cc:71:99:18:32:75:dc:be:b4:f8:ac:dc:19
    `https://repo-fastly.voidlinux.org/current' repository has been RSA signed by "Void Linux"
    Fingerprint: 60:ae:0c:d6:f0:95:17:80:bc:93:46:7a:89:af:a3:2d
    Do you want to import this public key? [Y/n]
    ```
    classabbyamp committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    47bae0a View commit details
    Browse the repository at this point in the history