From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
"open list:Network Block Dev..." <qemu-block@nongnu.org>,
rjones@redhat.com, Markus Armbruster <armbru@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 RFC] qemu-nbd: Permit TLS with Unix sockets
Date: Fri, 5 Jul 2019 11:34:50 +0100 [thread overview]
Message-ID: <20190705103450.GG32473@redhat.com> (raw)
In-Reply-To: <265ccc9f-9df9-3885-ec79-fef36b8d0acc@redhat.com>
On Fri, Jul 05, 2019 at 11:31:51AM +0200, Max Reitz wrote:
> On 04.07.19 00:47, Eric Blake wrote:
> > diff --git a/tests/qemu-iotests/233.out b/tests/qemu-iotests/233.out
> > index 9b46284ab0de..b86bee020649 100644
> > --- a/tests/qemu-iotests/233.out
> > +++ b/tests/qemu-iotests/233.out
>
> [...]
>
> > +== check TLS works over Unix ==
> > +image: nbd+unix://?socket=SOCKET
> > +file format: nbd
> > +virtual size: 64 MiB (67108864 bytes)
> > +disk size: unavailable
>
> This has worked surprisingly well considering you did not pass tls-hostname.
>
> On the same note: If I remove the tls-hostname option from the “perform
> I/O over TLS” test, it keeps working.
Yeah, that's a bug in crypto/tlssession.c.
It is assuming that the hostname will always be provided for sessions
in client mode, which was valid previously as all sessions were TCP
based. ie it assumed that if hostname was NULL, it was doing server
side certificate validation.
That assumption is bogus now we allow sessions on non-TCP, so we must
fix the code thus:
@@ -365,6 +367,14 @@ qcrypto_tls_session_check_certificate(QCryptoTLSSession *session,
goto error;
}
}
+ if (!session->hostname &&
+ session->creds->endpoint ==
+ QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT) {
+ error_setg(errp,
+ "No hostname available to validate against "
+ "server's x509 certificate");
+ goto error;
+ }
if (session->hostname) {
if (!gnutls_x509_crt_check_hostname(cert, session->hostname)) {
error_setg(errp,
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2019-07-05 10:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-03 22:47 [Qemu-devel] [PATCH v2 RFC] qemu-nbd: Permit TLS with Unix sockets Eric Blake
2019-07-04 3:09 ` no-reply
2019-07-05 9:31 ` Max Reitz
2019-07-05 10:34 ` Daniel P. Berrangé [this message]
2019-07-05 21:07 ` Eric Blake
2019-07-05 10:31 ` Daniel P. Berrangé
2019-07-05 10:37 ` Daniel P. Berrangé
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=20190705103450.GG32473@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).