From f8f6231ecdb99595a07e6c3933dedd7438ef4f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Sat, 30 Jun 2012 02:54:20 +0200 Subject: [PATCH] Fix a gcc warning warning: suggest explicit braces to avoid ambiguous 'else' --- common/ssl_verify.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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