libvirt/tests/qemucapabilitiesdata
Eric Blake a21cfb0f48 qemu: ask for -enable-fips when FIPS is required
On a system that is enforcing FIPS, most libraries honor the
current mode by default.  Qemu, on the other hand, refused to
honor FIPS mode unless you add the '-enable-fips' command
line option; worse, this option is not discoverable via QMP,
and is only present on binaries built for Linux.  So, if we
detect FIPS mode, then we unconditionally ask for FIPS; either
qemu is new enough to have the option and then correctly
cripple insecure VNC passwords, or it is so old that we are
correctly avoiding a FIPS violation by preventing qemu from
starting.  Meanwhile, if we don't detect FIPS mode, then
omitting the argument is safe whether the qemu has the option
(but it would do nothing because FIPS is disabled) or whether
qemu lacks the option (including in the case where we are not
running on Linux).

The testsuite was a bit interesting: we don't want our test
to depend on whether it is being run in FIPS mode, so I had
to tweak things to set the capability bit outside of our
normal interaction with capability parsing.

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1035474

* src/qemu/qemu_capabilities.h (QEMU_CAPS_ENABLE_FIPS): New bit.
* src/qemu/qemu_capabilities.c (virQEMUCapsInitQMP): Conditionally
set capability according to detection of FIPS mode.
* src/qemu/qemu_command.c (qemuBuildCommandLine): Use it.
* tests/qemucapabilitiestest.c (testQemuCaps): Conditionally set
capability to test expected output.
* tests/qemucapabilitiesdata/caps_1.2.2-1.caps: Update list.
* tests/qemucapabilitiesdata/caps_1.6.0-1.caps: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-12-18 07:05:29 -07:00
..
caps_1.2.2-1.caps qemu: ask for -enable-fips when FIPS is required 2013-12-18 07:05:29 -07:00
caps_1.2.2-1.replies qemu: don't use deprecated -no-kvm-pit-reinjection 2013-11-05 16:04:06 +01:00
caps_1.3.1-1.caps qemu: don't use deprecated -no-kvm-pit-reinjection 2013-11-05 16:04:06 +01:00
caps_1.3.1-1.replies qemu: don't use deprecated -no-kvm-pit-reinjection 2013-11-05 16:04:06 +01:00
caps_1.4.2-1.caps qemu: don't use deprecated -no-kvm-pit-reinjection 2013-11-05 16:04:06 +01:00
caps_1.4.2-1.replies qemu: don't use deprecated -no-kvm-pit-reinjection 2013-11-05 16:04:06 +01:00
caps_1.5.3-1.caps qemu: check for reboot-timeout on monitor 2013-12-13 15:20:09 +01:00
caps_1.5.3-1.replies qemu: don't use deprecated -no-kvm-pit-reinjection 2013-11-05 16:04:06 +01:00
caps_1.6.0-1.caps qemu: ask for -enable-fips when FIPS is required 2013-12-18 07:05:29 -07:00
caps_1.6.0-1.replies qemu: don't use deprecated -no-kvm-pit-reinjection 2013-11-05 16:04:06 +01:00
caps_1.6.50-1.caps qemu: check for reboot-timeout on monitor 2013-12-13 15:20:09 +01:00
caps_1.6.50-1.replies qemu: don't use deprecated -no-kvm-pit-reinjection 2013-11-05 16:04:06 +01:00