summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2012-06-30 02:54:20 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-06-30 02:54:53 +0200
commitf8f6231ecdb99595a07e6c3933dedd7438ef4f1d (patch)
treec45fa922944500053756cafceb5153810ae33366
parent5020adc59f0c296e11888487126be2574ec94863 (diff)
Fix a gcc warning
warning: suggest explicit braces to avoid ambiguous 'else'
-rw-r--r--common/ssl_verify.c9
1 files 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