From: "Andreas Färber" <afaerber@suse.de>
To: Paul Moore <pmoore@redhat.com>
Cc: Stefan Weil <sw@weilnetz.de>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vnc: disable VNC password authentication (security type 2) when in FIPS mode
Date: Wed, 02 May 2012 00:54:21 +0200 [thread overview]
Message-ID: <4FA0699D.6090302@suse.de> (raw)
In-Reply-To: <20120501212040.27850.27184.stgit@sifl>
Am 01.05.2012 23:20, schrieb Paul Moore:
> FIPS 140-2 requires disabling certain ciphers, including DES, which is used
> by VNC to obscure passwords when they are sent over the network. The
> solution for FIPS users is to disable the use of VNC password auth when the
> host system is operating in FIPS mode.
>
> This patch causes qemu to emits a syslog entry indicating that VNC password
"to emit"
> auth is disabled when it detects the host is running in FIPS mode, and
> unless a VNC password was specified on the command line it continues
> normally. However, if a VNC password was given on the command line, qemu
> fails with an error message to stderr explaining that that VNC password
"explaining that VNC"
> auth is not allowed in FIPS mode.
>
> Signed-off-by: Paul Moore <pmoore@redhat.com>
Interesting feature. :)
> diff --git a/ui/vnc.c b/ui/vnc.c
> index deb9ecd..620791e 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -32,6 +32,7 @@
> #include "acl.h"
> #include "qemu-objects.h"
> #include "qmp-commands.h"
> +#include <syslog.h>
syslog.h is POSIX, but it'll need a guard for mingw32.
> @@ -48,6 +49,24 @@ static DisplayChangeListener *dcl;
> static int vnc_cursor_define(VncState *vs);
> static void vnc_release_modifiers(VncState *vs);
>
> +static int fips_enabled(void)
> +{
> + int enabled = 0;
> + char value;
> + FILE *fds;
> +
> + fds = fopen("/proc/sys/crypto/fips_enabled", "r");
How standardized is this? Should we limit this to __linux__ or something?
> + if (fds == NULL) {
> + return 0;
> + }
> + if (fread(&value, sizeof(value), 1, fds) == 1 && value == '1') {
> + enabled = 1;
> + }
> + fclose(fds);
> +
> + return enabled;
> +}
bool would seem nicer as return type and field type below.
Andreas
> +
> static void vnc_set_share_mode(VncState *vs, VncShareMode mode)
> {
> #ifdef _VNC_DEBUG
> diff --git a/ui/vnc.h b/ui/vnc.h
> index a851ebd..8746a98 100644
> --- a/ui/vnc.h
> +++ b/ui/vnc.h
> @@ -160,6 +160,7 @@ struct VncDisplay
> char *display;
> char *password;
> time_t expires;
> + int fips;
> int auth;
> bool lossy;
> bool non_adaptive;
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-05-01 22:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-01 21:20 [Qemu-devel] [PATCH] vnc: disable VNC password authentication (security type 2) when in FIPS mode Paul Moore
2012-05-01 22:54 ` Andreas Färber [this message]
2012-05-02 10:28 ` Christoph Hellwig
2012-05-02 11:05 ` Daniel P. Berrange
2012-05-02 15:45 ` Paul Moore
2012-05-01 23:26 ` Anthony Liguori
2012-05-01 23:43 ` George Wilson
2012-05-01 23:45 ` Anthony Liguori
2012-05-02 0:17 ` George Wilson
2012-05-02 9:29 ` Daniel P. Berrange
2012-05-02 9:16 ` Daniel P. Berrange
2012-05-02 9:18 ` Daniel P. Berrange
2012-05-02 15:50 ` Paul Moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FA0699D.6090302@suse.de \
--to=afaerber@suse.de \
--cc=pmoore@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.