All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raghavendra D Prabhu <raghu.prabhu13@gmail.com>
To: qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org, Raghavendra D Prabhu <rprabhu@wnohang.net>
Subject: [PATCH 1/3] Avoid the use of deprecated gnutls gnutls_*_set_priority functions.
Date: Tue,  5 Jul 2011 03:30:00 +0530	[thread overview]
Message-ID: <51b5cbebc488fc126339651120e923934fe29928.1309816302.git.rprabhu@wnohang.net> (raw)
In-Reply-To: <cover.1309816302.git.rprabhu@wnohang.net>

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(-)

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);
-- 
1.7.6


WARNING: multiple messages have this Message-ID (diff)
From: Raghavendra D Prabhu <raghu.prabhu13@gmail.com>
To: qemu-devel@nongnu.org
Cc: Raghavendra D Prabhu <rprabhu@wnohang.net>, kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH 1/3] Avoid the use of deprecated gnutls gnutls_*_set_priority functions.
Date: Tue,  5 Jul 2011 03:30:00 +0530	[thread overview]
Message-ID: <51b5cbebc488fc126339651120e923934fe29928.1309816302.git.rprabhu@wnohang.net> (raw)
In-Reply-To: <cover.1309816302.git.rprabhu@wnohang.net>

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(-)

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);
-- 
1.7.6

  reply	other threads:[~2011-07-04 22:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-04 21:59 [PATCH 0/3] Build fixes Raghavendra D Prabhu
2011-07-04 21:59 ` [Qemu-devel] " Raghavendra D Prabhu
2011-07-04 22:00 ` Raghavendra D Prabhu [this message]
2011-07-04 22:00   ` [Qemu-devel] [PATCH 1/3] Avoid the use of deprecated gnutls gnutls_*_set_priority functions Raghavendra D Prabhu
2011-08-22  8:26   ` Stefan Hajnoczi
2011-08-22  8:26     ` [Qemu-devel] " Stefan Hajnoczi
2011-08-22 10:13     ` Gerd Hoffmann
2011-08-22 10:13       ` [Qemu-devel] " Gerd Hoffmann
2011-08-25 10:54   ` Stefan Hajnoczi
2011-08-25 10:54     ` [Qemu-devel] " Stefan Hajnoczi
2011-08-25 11:02     ` Daniel P. Berrange
2011-08-25 11:02       ` [Qemu-devel] " Daniel P. Berrange
2011-07-04 22:00 ` [PATCH 2/3] Add fno-strict-overflow Raghavendra D Prabhu
2011-07-04 22:00   ` [Qemu-devel] " Raghavendra D Prabhu
2011-07-04 22:38   ` Peter Maydell
2011-07-04 22:38     ` Peter Maydell
2011-07-05  5:41     ` Stefan Hajnoczi
2011-07-05  5:41       ` Stefan Hajnoczi
2011-07-05  9:34       ` Stefan Hajnoczi
2011-07-05  9:34         ` Stefan Hajnoczi
2011-07-05 15:36     ` Raghavendra D Prabhu
2011-07-05 20:30       ` Stefan Hajnoczi
2011-07-07 21:51         ` Raghavendra D Prabhu
2011-07-04 22:00 ` [PATCH 3/3] Avoid Wunsed-but-set warnings (or errors in case of Werror) Raghavendra D Prabhu
2011-07-04 22:00   ` [Qemu-devel] " Raghavendra D Prabhu
2011-07-05  6:15   ` Markus Armbruster
2011-07-05  6:15     ` Markus Armbruster
2011-07-05  7:02     ` Peter Maydell
2011-07-05  7:02       ` Peter Maydell
2011-07-05  7:49       ` Markus Armbruster
2011-07-05  8:05         ` Paolo Bonzini

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=51b5cbebc488fc126339651120e923934fe29928.1309816302.git.rprabhu@wnohang.net \
    --to=raghu.prabhu13@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rprabhu@wnohang.net \
    /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.