summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--include/crypto/init.h2
-rw-r--r--tests/crypto-tls-x509-helpers.c3
2 files changed, 4 insertions, 1 deletions
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();