Patchwork Build fixes

login
register
mail settings
Submitter Raghavendra D Prabhu
Date July 2, 2011, 2:06 p.m.
Message ID <20110702140646.GA4425@Xye>
Download mbox | patch
Permalink /patch/102991/
State New
Headers show

Comments

Raghavendra D Prabhu - July 2, 2011, 2:06 p.m.
Hi,
     With default configure, the qemu-kvm client build was failing for me
     since Werror is enabled by default in configure.
     Deprecations (gnutls), gcc signed-overflow optimization
     (Werror=strict-overflows) and few unused-but-set variables were
     causing it. I have attached the patches after applying which, I got
     no further errors.

--------------------------
Raghavendra Prabhu
GPG Id : 0xD72BE977
Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977
www: wnohang.net
From 51b5cbebc488fc126339651120e923934fe29928 Mon Sep 17 00:00:00 2001
Message-Id: <51b5cbebc488fc126339651120e923934fe29928.1309612724.git.rprabhu@wnohang.net>
From: Raghavendra D Prabhu <rprabhu@wnohang.net>
Date: Sat, 2 Jul 2011 17:33:40 +0530
Subject: [PATCH 1/3] Avoid the use of deprecated gnutls gnutls_*_set_priority
 functions.

The gnutls_*_set_priority family of functions has been marked deprecated
in 2.12.x. These functions have been superceded by
gnutls_priority_set_direct().

Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net>
---
 ui/vnc-tls.c |   20 +-------------------
 1 files changed, 1 insertions(+), 19 deletions(-)
Stefan Hajnoczi - July 2, 2011, 2:58 p.m.
On Sat, Jul 2, 2011 at 3:06 PM, Raghavendra D Prabhu
<rprabhu@wnohang.net> wrote:
>    With default configure, the qemu-kvm client build was failing for me
>    since Werror is enabled by default in configure.
>    Deprecations (gnutls), gcc signed-overflow optimization
>    (Werror=strict-overflows) and few unused-but-set variables were
>    causing it. I have attached the patches after applying which, I got
>    no further errors.

Thanks for the patches.  Please submit patches as individual inline
emails so that it is easy to review and reply to them.  For more
information, see http://wiki.qemu.org/Contribute/SubmitAPatch.

Stefan
Raghavendra D Prabhu - July 4, 2011, 10:02 p.m.
* On Sat, Jul 02, 2011 at 03:58:34PM +0100, Stefan Hajnoczi <stefanha@gmail.com> wrote:
>On Sat, Jul 2, 2011 at 3:06 PM, Raghavendra D Prabhu
><rprabhu@wnohang.net> wrote:
>>    With default configure, the qemu-kvm client build was failing for me
>>    since Werror is enabled by default in configure.
>>    Deprecations (gnutls), gcc signed-overflow optimization
>>    (Werror=strict-overflows) and few unused-but-set variables were
>>    causing it. I have attached the patches after applying which, I got
>>    no further errors.
>
>Thanks for the patches.  Please submit patches as individual inline
>emails so that it is easy to review and reply to them.  For more
>information, see http://wiki.qemu.org/Contribute/SubmitAPatch.
>
>Stefan
>
Thanks. I have sent them correctly this time. 

--------------------------
Raghavendra Prabhu
GPG Id : 0xD72BE977
Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977
www: wnohang.net

Patch

diff --git a/ui/vnc-tls.c b/ui/vnc-tls.c
index dec626c..33a5d8c 100644
--- a/ui/vnc-tls.c
+++ b/ui/vnc-tls.c
@@ -286,10 +286,6 @@  int vnc_tls_validate_certificate(struct VncState *vs)
 
 int vnc_tls_client_setup(struct VncState *vs,
                          int needX509Creds) {
-    static const int cert_type_priority[] = { GNUTLS_CRT_X509, 0 };
-    static const int protocol_priority[]= { GNUTLS_TLS1_1, GNUTLS_TLS1_0, GNUTLS_SSL3, 0 };
-    static const int kx_anon[] = {GNUTLS_KX_ANON_DH, 0};
-    static const int kx_x509[] = {GNUTLS_KX_DHE_DSS, GNUTLS_KX_RSA, GNUTLS_KX_DHE_RSA, GNUTLS_KX_SRP, 0};
 
     VNC_DEBUG("Do TLS setup\n");
     if (vnc_tls_initialize() < 0) {
@@ -310,21 +306,7 @@  int vnc_tls_client_setup(struct VncState *vs,
             return -1;
         }
 
-        if (gnutls_kx_set_priority(vs->tls.session, needX509Creds ? kx_x509 : kx_anon) < 0) {
-            gnutls_deinit(vs->tls.session);
-            vs->tls.session = NULL;
-            vnc_client_error(vs);
-            return -1;
-        }
-
-        if (gnutls_certificate_type_set_priority(vs->tls.session, cert_type_priority) < 0) {
-            gnutls_deinit(vs->tls.session);
-            vs->tls.session = NULL;
-            vnc_client_error(vs);
-            return -1;
-        }
-
-        if (gnutls_protocol_set_priority(vs->tls.session, protocol_priority) < 0) {
+        if (gnutls_priority_set_direct(vs->tls.session, needX509Creds ? "NORMAL" : "NORMAL:+ANON-DH", NULL) < 0) {
             gnutls_deinit(vs->tls.session);
             vs->tls.session = NULL;
             vnc_client_error(vs);