[Spice-commits] common/ssl_verify.c

Marc-André Lureau elmarco at kemper.freedesktop.org
Fri Jun 29 17:55:22 PDT 2012


 common/ssl_verify.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit f8f6231ecdb99595a07e6c3933dedd7438ef4f1d
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date:   Sat Jun 30 02:54:20 2012 +0200

    Fix a gcc warning
    
    warning: suggest explicit braces to avoid ambiguous 'else'

diff --git a/common/ssl_verify.c b/common/ssl_verify.c
index 56b25ac..6c9deca 100644
--- a/common/ssl_verify.c
+++ b/common/ssl_verify.c
@@ -446,27 +446,30 @@ static int openssl_verify(int preverify_ok, X509_STORE_CTX *ctx)
     }
 
     failed_verifications = 0;
-    if (v->verifyop & SPICE_SSL_VERIFY_OP_PUBKEY)
+    if (v->verifyop & SPICE_SSL_VERIFY_OP_PUBKEY) {
         if (verify_pubkey(cert, v->pubkey, v->pubkey_size))
             return 1;
         else
             failed_verifications |= SPICE_SSL_VERIFY_OP_PUBKEY;
+    }
 
     if (!v->all_preverify_ok || !preverify_ok)
         return 0;
 
-    if (v->verifyop & SPICE_SSL_VERIFY_OP_HOSTNAME)
+    if (v->verifyop & SPICE_SSL_VERIFY_OP_HOSTNAME) {
        if (verify_hostname(cert, v->hostname))
            return 1;
         else
             failed_verifications |= SPICE_SSL_VERIFY_OP_HOSTNAME;
+    }
 
 
-    if (v->verifyop & SPICE_SSL_VERIFY_OP_SUBJECT)
+    if (v->verifyop & SPICE_SSL_VERIFY_OP_SUBJECT) {
         if (verify_subject(cert, v))
             return 1;
         else
             failed_verifications |= SPICE_SSL_VERIFY_OP_SUBJECT;
+    }
 
     /* If we reach this code, this means all the tests failed, thus
      * verification failed


More information about the Spice-commits mailing list