Commit Graph

30 Commits

Author SHA1 Message Date
Richard Hughes
9bc9debd98 Allow uploading security attributes to the LVFS
We sign the data with the client cert to allow users with LVFS accounts to
publish 'official' HSI ratings.
2020-05-21 11:48:09 +01:00
Richard Hughes
a1de20665a Load the signature to get the aliased CDN-safe version of the metadata
Switch to downloading the signature first, which we can then load to get the
suffixed build-specific URL of the actual metadata file. You need to have
libjcat 0.1.1 installed and fwupd built against the new version for this to
work.

Fixes https://github.com/fwupd/fwupd/issues/391
2020-04-03 16:27:04 +01:00
Mario Limonciello
34c366aab2 Add support for automatically uploading reports 2019-09-30 16:21:23 -05:00
Mario Limonciello
d1681e6de5 libfwupd: Add a new private function fwupd_remote_set_remotes_dir
This allows the daemon to set the base directory to store remotes.

This fixes issues with systemd where the installation prefix was set
to soemthing not writable such as `/usr/local` but systemd
`STATE_DIRECTORY` doesn't match up.

```
$ fwupdmgr refresh
Fetching metadata https://cdn.fwupd.org/downloads/firmware.xml.gz
Downloading…             [***************************************] Less than one minute remaining…
Fetching signature https://cdn.fwupd.org/downloads/firmware.xml.gz.asc

Failed to update metadata for lvfs: Error creating directory /usr/local/var/lib/fwupd/remotes.d: Read-only file system
```

It should also hopefully help with immutable systems.
2019-08-29 11:44:32 -05:00
Richard Hughes
e2a92690da Allow client code to construct objects from GVariant blobs
Rather than wrapping every sync D-Bus call with a GTask helper (hundreds of
additional lines of code and dozens of new entrypoints in libfwupd) I think it
is best for client software wanting async operation just uses the D-Bus
interface. I consider it part of the API as much as the shared library and
I don't see it changing in a non-compatible way any time soon.

Exposing these already-exported symbols allows client software to use the
demarshalling functionality and to operate on the GObjects directly from an
existing GDBus async return value.
2019-07-03 11:44:31 +01:00
Richard Hughes
23b1a9d3be trivial: Add missing gtk-doc for _REMOTE_KIND_DIRECTORY 2019-03-21 10:09:11 +00:00
Richard Hughes
8dd4c1c4dd Allow restricting firmware updates for enterprise use 2019-03-05 19:05:07 +00:00
Richard Hughes
bfd946e463 Use '#pragma once' to avoid a lot of boilerplate 2019-02-09 08:42:30 -06:00
Mario Limonciello
706ab43898 libfwupd: Add support for new remote type "directory"
This remote will be used for automatically building metadata based
on files in a directory.
2019-01-29 09:21:54 -06:00
Richard Hughes
02c90d8a03 Remove the unused Emacs indenting headers from all source files
Fixes https://github.com/hughsie/fwupd/issues/636
2018-08-09 12:48:04 +01:00
Mario Limonciello
51308e648a Adjust all licensing to LGPL 2.1+ (Closes: #526) 2018-05-29 09:03:13 +01:00
Richard Hughes
8aa7239240 trivial: Fix some Gtk-Doc mistakes
Fixes https://github.com/hughsie/fwupd/issues/487
2018-05-02 08:39:36 +01:00
Richard Hughes
1fd3ecf7a3 Export fwupd_remote_get_agreement()
We need to show this agreement text in every fwupd frontend and exporting a
helper function allows us to do two things:

 * Share the semi-complicated code (and fallback) to avoid copy and pasting

 * Easily change the code in the future, for instance allowing merging Metainfo
   and AppStream metadata without updating all the front ends with new logic.
2018-04-16 16:44:27 +01:00
Richard Hughes
d29df0819f Allow specifying the reporting server in the remote key files 2018-01-11 20:20:00 +00:00
Richard Hughes
7f6d78fb1b Add fwupd_remote_get_checksum() to use in client programs 2017-09-28 09:23:52 +01:00
Richard Hughes
b2fb80925c trivial: Remove fwupd_remote_get_filename()
The data for these was just being generated internally based on the ID and the
basename of the original URI, and that's easy for the calling application to do
itself.
2017-09-28 09:23:52 +01:00
Richard Hughes
5b20c18656 trivial: Convert FwupdRemote from a FINAL to DERIVABLE type
The latter is best-practice in a library so that objects can be superclassed by
client programs.
2017-09-28 09:23:52 +01:00
Richard Hughes
b86ef97b36 trivial: Remove fwupd_remote_build_uri()
This also removes the long-deprecated fwupd_remote_get_uri() and fwupd_remote_get_uri_asc()
2017-09-28 09:23:52 +01:00
Richard Hughes
48ad97fd61 Add a human-readable title for each remote
This allows us to show something useful in a GUI.
2017-09-10 09:08:32 +01:00
Richard Hughes
b4fd0dfd7d Move deprecated symbols to a new header
This does two things:

 * Allows new users of the library to see only the supported symbols
 * Allows us to ensure we're not using deprecated API internally

I can also use this in gnome-software in CI to make sure we're not using
deprecated API too. I don't think we're ready for a soname bump so we have to
hang on to the deprecated code for now.
2017-09-08 13:31:01 +01:00
Richard Hughes
a6bd5580d3 Add ModifyRemote as an easy way to enable and disable remotes like the LVFS
For example:

    $ fwupdmgr modify-remote lvfs-testing Enabled true
2017-09-07 23:02:58 +01:00
Richard Hughes
c6afb51e32 Add a FirmwareBaseURI parameter to the remote configs
This allows somebody to mirror the CDN without resigning the metadata files.

Fixes: https://github.com/hughsie/fwupd/issues/186
2017-08-23 14:22:12 +01:00
Richard Hughes
99e621d388 Save the metadata signature in the local cache
This is useful if the admin wants to re-verify the metadata, or if a public
key is removed or expires.
2017-08-16 13:42:10 +01:00
Richard Hughes
18c2a689d2 trivial: Reorder a function in a header 2017-08-16 13:42:10 +01:00
Richard Hughes
7403dc505f Optionally use GnuTLS to verify PKCS7 certificates
We can use this as an alternative for GPG. No PKCS7 certificates are currently
installed by fwupd and it's expected that the LVFS will still only provide GPG
detached signatures.

If an OEM distributor wants to sign firmware with a PKCS7 and the corresponding
certificate is provided then the firmware will be marked as valid.

Only firmware shipping with a .p7b file will use the PKCS7 functionality,
similarly remote metadata validation will default to GPG unless Keyring=pkcs7
is specified in the config file.
2017-08-14 09:42:48 +01:00
Richard Hughes
2d95a71a0c Support embedded devices with local firmware metadata
In this mode, both the metadata and firmware is stored on the local filesystem
and distributed using a distribution system like OSTree.

Fixes https://github.com/hughsie/fwupd/issues/162
2017-07-28 17:41:24 +01:00
Richard Hughes
feb8027ee3 Show the age of the remote metadata in 'fwupdmgr get-remotes'
Note: we have to transfer the mtime (not the age) when creating the GVariant,
as we want calls to fwupd_remote_get_age() to update the value without getting
the remote from the daemon each time.
2017-06-16 20:24:41 +01:00
Richard Hughes
f0bde3e4af Add a get-remotes command to fwupdmgr
This allows the user to show the configured remotes.
2017-06-16 14:31:20 +01:00
Richard Hughes
a71e0a71f6 Allow ordering the metadata remotes
This allows us to load one metadata source file before or after another.
2017-06-16 12:40:24 +01:00
Richard Hughes
dfed515573 Allow downloading metadata from more than just the LVFS
Add the concept of 'remotes' that can dropped into /etc and used as firmware
metadata sources. This may be desirable when firmware is only accessable with
a valid support contract or from behind a VPN.
2017-06-02 13:19:05 +01:00