render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Daniel P. Berrange b8cb75
From 3433180ec89195aef3c434d8c8d44d55b0bd6466 Mon Sep 17 00:00:00 2001
Daniel P. Berrange b8cb75
From: "Daniel P. Berrange" <berrange@redhat.com>
Daniel P. Berrange b8cb75
Date: Tue, 4 Aug 2015 12:26:15 +0100
Daniel P. Berrange b8cb75
Subject: [PATCH] tests: extend workaround for gnutls private key loading
Daniel P. Berrange b8cb75
 failure
Daniel P. Berrange b8cb75
Daniel P. Berrange b8cb75
In gnutls 3.4.3 there is a regression in the loading of private
Daniel P. Berrange b8cb75
keys via gnutls_x509_privkey_import. We already have a workaround
Daniel P. Berrange b8cb75
to deal with failures on older gnutls, but the error code that
Daniel P. Berrange b8cb75
the new gnutls returns is different. Extend the workaround so that
Daniel P. Berrange b8cb75
is checks for GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE too.
Daniel P. Berrange b8cb75
Daniel P. Berrange b8cb75
See also gnutls https://bugzilla.redhat.com/show_bug.cgi?id=1250020
Daniel P. Berrange b8cb75
Daniel P. Berrange b8cb75
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Daniel P. Berrange b8cb75
---
Daniel P. Berrange b8cb75
 tests/virnettlshelpers.c | 3 ++-
Daniel P. Berrange b8cb75
 1 file changed, 2 insertions(+), 1 deletion(-)
Daniel P. Berrange b8cb75
Daniel P. Berrange b8cb75
diff --git a/tests/virnettlshelpers.c b/tests/virnettlshelpers.c
Daniel P. Berrange b8cb75
index 6e667d1..531d0b9 100644
Daniel P. Berrange b8cb75
--- a/tests/virnettlshelpers.c
Daniel P. Berrange b8cb75
+++ b/tests/virnettlshelpers.c
Daniel P. Berrange b8cb75
@@ -84,7 +84,8 @@ static gnutls_x509_privkey_t testTLSLoadKey(void)
Daniel P. Berrange b8cb75
 
Daniel P. Berrange b8cb75
     if ((err = gnutls_x509_privkey_import(key, &data,
Daniel P. Berrange b8cb75
                                           GNUTLS_X509_FMT_PEM)) < 0) {
Daniel P. Berrange b8cb75
-        if (err != GNUTLS_E_BASE64_UNEXPECTED_HEADER_ERROR) {
Daniel P. Berrange b8cb75
+        if (err != GNUTLS_E_BASE64_UNEXPECTED_HEADER_ERROR &&
Daniel P. Berrange b8cb75
+            err != GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) {
Daniel P. Berrange b8cb75
             VIR_WARN("Failed to import key %s", gnutls_strerror(err));
Daniel P. Berrange b8cb75
             abort();
Daniel P. Berrange b8cb75
         }
Daniel P. Berrange b8cb75
-- 
Daniel P. Berrange b8cb75
2.4.3
Daniel P. Berrange b8cb75