Commit Graph

328 Commits

Author SHA1 Message Date
Richard Hughes
0f6d754d5a Detect if the MEI device has known security issues
If it has, fail HSI-1.
2020-06-01 22:49:39 +01:00
Richard Hughes
bb228cbe53 pci-mei: Check the HFS register for the override strap 2020-05-29 17:34:18 +01:00
Mario Limonciello
bb6b1a8693 Revert "amt: Add a security attestation for provisioning"
This reverts commit f160e6b7fc.
2020-05-22 15:13:19 +01:00
Richard Hughes
c821923668 Add an HSI attribute for Intel SMAP
See https://en.wikipedia.org/wiki/Supervisor_Mode_Access_Prevention for details.
2020-05-22 07:26:47 +01:00
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
6ecc4ca144 Export the report metadata on the D-Bus interface
This allows the client to easily query metadata to upload with the report,
without exporting rarely used attributes as D-Bus properties on the interface.

It also allows us to add extra metadata values in the future without changing
the public API.
2020-05-20 19:47:53 +01:00
Richard Hughes
0c6efe2e04 Revert "Export the host vendor, family and SKU"
This reverts commit 81c371098c.
2020-05-20 19:47:53 +01:00
Richard Hughes
81c371098c Export the host vendor, family and SKU
The 'product name' is not typically what the hardware is known as. We need the
vendor, family and SKU if the user is going to recognise the hardware.
2020-05-19 19:42:45 +01:00
Richard Hughes
b246bcaecb Allow client tools to translate the HSI attributes and results
To do this, rely on the AppStream ID to map to a translated string (providing a
fallback for clients that do not care) and switch the free-form result string
into a set of enumerated values that can be translated.

This fixes some of the problems where some things have to be enabled to "pass"
and other attributes have to be some other state. For cases where we want the
user to "do" something, provide a URL to a wiki page that we update out-of-band
of fwupd releases.
2020-05-18 17:03:49 +01:00
Richard Hughes
0613b3cdf3 trivial: Fix the docstring for fwupd_security_attr_set_name() 2020-05-15 16:17:27 +01:00
Richard Hughes
cae111d1de Save the plugin that created the FwupdSecurityAttr
This is really useful for debugging.
2020-05-15 16:17:27 +01:00
Richard Hughes
196c6c69db Add support for the Host Security ID
The HSI specification assigns a simple text ID to the current state of firmware
security. As new vulnerabilities are found, and as protection measures are
updated, new requirements will be added to the required firmware behaviours for
each HSI value.

The HSI specification is currently incomplete and in active development, and
so the --force flag is required in all command line tools. The current ID value
will probably change on a given platform so please do not start using the result
for any kind of compliance requirements.
2020-05-11 22:11:49 +01:00
Richard Hughes
173acd2e07 Add FwupdSecurityAttr to libfwupd
This will be used to store security attributes about platform security.
2020-05-11 17:52:41 +01:00
Mario Limonciello
768a2680a6 Introduce a new flag skips-restart
This flag is used internally by plugins to indicate that they will
skip the phase of firmware installation that power cycles a device.

It is intended to be set by quirks or other environment settings.
2020-05-06 15:13:40 -05:00
Richard Hughes
3aaf53c6f0 Allow specifying the device on the command line by GUID
The GUID is the only stable identifier, and allowing using the GUID makes it
much easier to test specific devices.
2020-04-20 18:45:45 +01:00
Richard Hughes
1bde4fdd29 Fix the DeviceID set by GetDetails
The returned ID is the result of the SHA1 hash of the actual device ID. This
does not match anything found by the client, and so the install fails.

The symbol is exported as I think the device ID is an important identifier and
used in various fwupd tools.

When backported to the stable branch the verification should just be a static
function in src/fu-engine.c rather than a new symbol.
2020-04-20 17:42:22 +01:00
Richard Hughes
8500b4f233 Allow devices to be updatable, but only when upgrading a proxy device 2020-04-18 14:39:43 +01:00
Richard Hughes
86ae91c144 Add a device quirk that forces an explicit device-id match
This means we do not do the GUID or counterpart GUID matching when adding
devices. Only an exact device-id match or when both the physical and logical
IDs match will the device be considered the 'same'.

This is to handle devices that could share the same GUIDs in both child and
parent modes where the logical ID differs.
2020-04-17 21:48:59 +01:00
Mario Limonciello
11a7423d24 trivial: skip some self tests if system isn't set up properly
```
ok 10 /fwupd/client{remotes} # SKIP no valid daemon: Error calling StartServiceByName for org.freedesktop.fwupd: Failed to activate service 'org.freedesktop.fwupd': timed out (service_start_timeout=25000ms)
ok 11 /fwupd/client{devices} # SKIP no valid daemon: Error calling StartServiceByName for org.freedesktop.fwupd: Failed to activate service 'org.freedesktop.fwupd': timed out (service_start_timeout=25000ms)

```
2020-04-10 06:50:51 -05:00
Richard Hughes
cddf5b5b89 Only auto-add counterpart GUIDs when required
Doing this unconditionally means we accidentally 'bleed' one device mode into
another in a non-obvious way. For instance, a device might have two operating
modes with different GUIDs. If firmware is supplied for both modes in the same
cabinet archive then we might accidentally match the 'wrong' firmware when
the daemon has observed a mode switch and added the counterpart GUIDs.

We only really need the counterpart GUIDs when switching between Jabra, 8bitdo
and DFU devices where the DFU bootloader VID:PID is not manually tagged with
`CounterpartGuid` in a quirk file. In the general case lets keep it simple to
avoid difficult to find bugs.
2020-04-08 13:55:39 +01:00
Richard Hughes
0bc65b5e97 Export the device state as part of the D-Bus interface 2020-04-07 15:04:01 +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
Richard Hughes
52c1a4d38e Export the release urgency
Show it in the various command line tools if it has been set by the vendor.
2020-04-02 13:22:07 +01:00
Richard Hughes
14797f8a86 Export the release creation time
Show it in the various command line tools if it has been set by the vendor.

Fixes https://github.com/fwupd/fwupd/issues/1945
2020-04-02 13:22:07 +01:00
Richard Hughes
d5aab65f30 Use Jcat files in firmware archives and for metadata
A Jcat file can be used to store GPG, PKCS-7 and SHA-256 checksums for multiple
files. This allows us to sign a firmware or metadata multiple times (perhaps
by the OEM and also then the LVFS) which further decentralizes the trust model
of the LVFS.

The Jcat format was chosen as the Microsoft catalog format is nonfree and not
documented. We also don't want to modify an existing .cat file created from WU
as this may make it unsuitable to use on Windows.

More information can be found here: https://github.com/hughsie/libjcat
2020-03-23 19:55:12 +00:00
Mario Limonciello
c8bae2a68c Introduce a new VersionFormat for hex
When CPU microcode is distributed it typically is versioned in
hexadecimal in all tools.  Converting it to any of the existing version
formats provides an unexpected result that requires converting back to
hexadecimal.
2020-03-06 08:12:58 -06:00
Mario Limonciello
96117d19df trivial: 1.3.9->1.4.0
We decided to branch at 1.3.8 and backport fix only things for 1_3_X.
So bump all the new stuff to 1.4.0 (which will be next release)
2020-02-28 10:17:56 -06:00
Richard Hughes
b097603800 Allow server metadata to set the version format on some devices
It appears just choosing 'if Dell then QUAD else TRIPLET' isn't good enough.
2020-02-26 15:45:40 +00:00
Mario Limonciello
c1776c9ad4 Add raw versions for bootloader and lowest
The assumption is that same version format is used for all 3 of these
versions.
2020-02-25 12:20:51 +00:00
Richard Hughes
f43381f4a7 Allow server metadata to set the device name on some devices
This does 'bleed' the metadata contents into areas previously covered by quirks,
but in this case may be pragmatic and more up to date than a build-time
generated quirk file, which increases the user-friendliness of fwupdmgr.
2020-02-24 14:15:34 +00:00
Richard Hughes
af14073522 Allow applying all releases to get to a target version
Some hardware does not handle upgrading from version 1.2.2 to 1.2.4 and instead
needs to be upgraded from 1.2.2->1.2.3->1.2.4 so that on-device metadata can be
migrated correctly.

Add a new per-device flag `install-all-releases` which causes the daemon to not
skip directly to the newest release. This is designed to be set from a quirk
file.

This can obviously only be used for devices that can apply firmware "live" and
thus do not need a reboot or system shutdown to actually apply the firmware.
This also needs the cabinet archive to ship multiple versions of the firmware,
and for the metainfo.xml file to refer to multiple release objects.
2020-01-07 15:33:12 +00:00
Richard Hughes
1eb7c7443e Allow quirking devices that always require a version check
These are devices that we have to be careful with the version numbers, for
instance only updating from versions that have already had data migration
completed.

The new flag can be set in quirk files or on the objects directly.
2020-01-07 12:29:28 +00:00
Richard Hughes
30ef455d50 Allow the client to get the list of FwupdDevice children
These can only be assigned using fwupd_device_set_parent(), typically from
fwupd_device_array_ensure_parents().
2020-01-06 15:16:48 +00:00
Richard Hughes
0ef47201eb Set the FwupdDevice parents in fwupdtool
This requires splitting out a helper function as a new symbol so it can be used
without fwupd_device_array_from_variant().
2020-01-06 15:16:48 +00:00
Richard Hughes
0731b825f4 trivial: Render large values of VersionRaw in a more portable way 2019-12-05 10:56:41 -06:00
Richard Hughes
f1a7122250 Add a dell-bios version format
Dell does not include the first byte in the ESRT value, ignoring it. Using a
`quad` means we get versions like `0.1.4.0` rather than `1.4.0` which confuses
both users comparing versions to the vendor website, and also anyone trying to
do analysis on the firmware.
2019-12-04 16:22:46 +00:00
Richard Hughes
da80c1bda3 trivial: Convert the VersionRaw value to a uint64_t for future use
This has not been in any tarball release and so isn't a ABI break.
2019-12-03 10:46:17 -06:00
Richard Hughes
45a00738d8 Allow building on Windows with MinGW
Add various fixes to enable us to build a selection of useful USB plugins.
Also, skip tests that don't make sense on WIN32 or that will not work.

With much help from Mario Limonciello <mario.limonciello@dell.com> -- Thanks!
2019-12-03 16:33:43 +00:00
Richard Hughes
10079e6b8c Export the raw device version to the client --verbose output
It turns out this is really useful for debugging UEFI firmware updates which
typically use the 0x-prefixed version numbers without a version format.
2019-12-02 06:51:25 +00:00
Richard Hughes
4f023420c6 Export the device protocol to the client --verbose output
It turns out this is useful for debugging.
2019-12-01 06:31:05 -06:00
Richard Hughes
3ee52ca4dd trivial: Include the Fwupd GIR in the FwupdPLugin GIR 2019-11-27 12:45:35 +00:00
Mario Limonciello
6b0e66354b Convert libfwupdprivate to a shared library libfwupdplugin 2019-11-27 11:32:43 +00:00
Richard Hughes
9e5675e1b4 trivial: Allow compiling without <glib-unix.h> 2019-11-26 17:15:45 +00:00
Richard Hughes
5c508de173 trivial: Allow compiling without <fnmatch.h>
This also allows us to add a Win32 implementation if required in the future.
2019-11-26 13:13:31 +00:00
Richard Hughes
be956bdb66 Allow setting the device flags using GObject properties 2019-11-25 18:10:38 -06:00
Richard Hughes
668ee21567 trivial: Use prefixes for DATADIR in config.h for portability
DATADIR is an enumerated type in MinGW, and the other names are very generic.
2019-11-24 14:17:38 -06:00
Richard Hughes
b026e456f3 trivial: Allow compiling without HAVE_LC_MESSAGES 2019-11-23 17:07:53 +00:00
Richard Hughes
fc1e267d33 trivial: Allow compiling without <sys/utsname.h> 2019-11-23 17:07:53 +00:00
Richard Hughes
17957ebf13 Ensure the _get_type() gets the same ABI version as the constructor
This was also causing the _get_type() symbol to be ignored for objects without
any class methods except constructors.
2019-11-23 12:59:47 +00:00
Mario Limonciello
eb4c76416c Add a new property Interactive to the daemon
Clients can use this as a hint whether the daemon is running on
a terminal.

`fwupdmgr` uses this to bypass the systemd service check.
2019-11-11 11:16:21 -06:00