All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>
Subject: [Qemu-devel] [PULL 1/4] tests: call qcrypto_init instead of gnutls_global_init
Date: Tue, 24 Jul 2018 17:44:45 +0100	[thread overview]
Message-ID: <20180724164448.7606-2-berrange@redhat.com> (raw)
In-Reply-To: <20180724164448.7606-1-berrange@redhat.com>

Calling qcrypto_init ensures that all relevant initialization is
done. In particular this honours the debugging settings and thread
settings.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 include/crypto/init.h           | 2 ++
 tests/crypto-tls-x509-helpers.c | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/crypto/init.h b/include/crypto/init.h
index 04c1edf770..f79c02266b 100644
--- a/include/crypto/init.h
+++ b/include/crypto/init.h
@@ -21,6 +21,8 @@
 #ifndef QCRYPTO_INIT_H
 #define QCRYPTO_INIT_H
 
+#include "qapi/error.h"
+
 int qcrypto_init(Error **errp);
 
 #endif /* QCRYPTO_INIT_H */
diff --git a/tests/crypto-tls-x509-helpers.c b/tests/crypto-tls-x509-helpers.c
index 173d4e28fb..9b669c2a4b 100644
--- a/tests/crypto-tls-x509-helpers.c
+++ b/tests/crypto-tls-x509-helpers.c
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 
 #include "crypto-tls-x509-helpers.h"
+#include "crypto/init.h"
 #include "qemu/sockets.h"
 
 #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
@@ -95,7 +96,7 @@ static gnutls_x509_privkey_t test_tls_load_key(void)
 
 void test_tls_init(const char *keyfile)
 {
-    gnutls_global_init();
+    qcrypto_init(&error_abort);
 
     if (asn1_array2tree(pkix_asn1_tab, &pkix_asn1, NULL) != ASN1_SUCCESS) {
         abort();
-- 
2.17.1

  reply	other threads:[~2018-07-24 16:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 16:44 [Qemu-devel] [PULL 0/4] Qcrypto next patches Daniel P. Berrangé
2018-07-24 16:44 ` Daniel P. Berrangé [this message]
2018-07-24 16:44 ` [Qemu-devel] [PULL 2/4] tests: don't silence error reporting for all tests Daniel P. Berrangé
2018-07-24 16:44 ` [Qemu-devel] [PULL 3/4] tests: use error_abort in places expecting errors Daniel P. Berrangé
2018-07-24 16:44 ` [Qemu-devel] [PULL 4/4] tests: fix TLS handshake failure with TLS 1.3 Daniel P. Berrangé
2018-07-24 19:16 ` [Qemu-devel] [PULL 0/4] Qcrypto next patches Peter Maydell

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=20180724164448.7606-2-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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.