]> git.proxmox.com Git - mirror_qemu.git/blobdiff - tests/crypto-tls-x509-helpers.c
hw/display/cirrus_vga: Update the documentation URL
[mirror_qemu.git] / tests / crypto-tls-x509-helpers.c
index 47b4c7ba53fe60ed531f4718f4cd6ef7c8a061f6..9b669c2a4bc6473c3016d885751e30bc43e79dbd 100644 (file)
  * Author: Daniel P. Berrange <berrange@redhat.com>
  */
 
-#include <stdlib.h>
-#include <fcntl.h>
+#include "qemu/osdep.h"
 
-#include "config-host.h"
 #include "crypto-tls-x509-helpers.h"
+#include "crypto/init.h"
 #include "qemu/sockets.h"
 
 #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
@@ -97,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();
@@ -408,7 +407,8 @@ test_tls_generate_cert(QCryptoTLSTestCertReq *req,
      * If no 'ca' is set then we are self signing
      * the cert. This is done for the root CA certs
      */
-    err = gnutls_x509_crt_sign(crt, ca ? ca : crt, privkey);
+    err = gnutls_x509_crt_sign2(crt, ca ? ca : crt, privkey,
+                                GNUTLS_DIG_SHA256, 0);
     if (err < 0) {
         g_critical("Failed to sign certificate %s",
                    gnutls_strerror(err));