diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2016-06-06 10:05:06 +0100 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2016-07-04 15:53:19 +0100 |
commit | a1c5e949ddc3234dcb85a44b9cb9312cd9f3522f (patch) | |
tree | 64d6aca0612b3ab851f97fa028a4445876901290 /crypto | |
parent | 13f12430d48b62e2304e0e5a7c607279af68b98a (diff) | |
download | qemu-a1c5e949ddc3234dcb85a44b9cb9312cd9f3522f.zip qemu-a1c5e949ddc3234dcb85a44b9cb9312cd9f3522f.tar.gz qemu-a1c5e949ddc3234dcb85a44b9cb9312cd9f3522f.tar.bz2 |
crypto: allow default TLS priority to be chosen at build time
Modern gnutls can use a global config file to control the
crypto priority settings for TLS connections. For example
the priority string "@SYSTEM" instructs gnutls to find the
priority setting named "SYSTEM" in the global config file.
Latest gnutls GIT codebase gained the ability to reference
multiple priority strings in the config file, with the first
one that is found to existing winning. This means it is now
possible to configure QEMU out of the box with a default
priority of "@QEMU,SYSTEM", which says to look for the
settings "QEMU" first, and if not found, use the "SYSTEM"
settings.
To make use of this facility, we introduce the ability to
set the QEMU default priority at build time via a new
configure argument. It is anticipated that distro vendors
will set this when building QEMU to a suitable value for
use with distro crypto policy setup. eg current Fedora
would run
./configure --tls-priority=@SYSTEM
while future Fedora would run
./configure --tls-priority=@QEMU,SYSTEM
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/tlssession.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/tlssession.c b/crypto/tlssession.c index 2112d29..2de42c6 100644 --- a/crypto/tlssession.c +++ b/crypto/tlssession.c @@ -137,7 +137,7 @@ qcrypto_tls_session_new(QCryptoTLSCreds *creds, if (creds->priority != NULL) { prio = g_strdup_printf("%s:+ANON-DH", creds->priority); } else { - prio = g_strdup("NORMAL:+ANON-DH"); + prio = g_strdup(CONFIG_TLS_PRIORITY ":+ANON-DH"); } ret = gnutls_priority_set_direct(session->handle, prio, NULL); @@ -167,7 +167,7 @@ qcrypto_tls_session_new(QCryptoTLSCreds *creds, QCryptoTLSCredsX509 *tcreds = QCRYPTO_TLS_CREDS_X509(creds); const char *prio = creds->priority; if (!prio) { - prio = "NORMAL"; + prio = CONFIG_TLS_PRIORITY; } ret = gnutls_priority_set_direct(session->handle, prio, NULL); |