mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-01-09 22:25:28 +00:00
Avoid warnings about empty conditional statement bodies
Add extra {} braces around if/else statements which only
call SPICE_DEBUG to avoid:
../common/ssl_verify.c: In function 'verify_pubkey':
../common/ssl_verify.c:87:50: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
../common/ssl_verify.c: In function 'verify_hostname':
../common/ssl_verify.c:254:53: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
../common/ssl_verify.c: In function 'verify_subject':
../common/ssl_verify.c:381:41: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
This commit is contained in:
parent
0a96fe9364
commit
3bc7d096b6
@ -83,12 +83,13 @@ static int verify_pubkey(X509* cert, const char *key, size_t key_size)
|
||||
|
||||
ret = EVP_PKEY_cmp(orig_pubkey, cert_pubkey);
|
||||
|
||||
if (ret == 1)
|
||||
if (ret == 1) {
|
||||
SPICE_DEBUG("public keys match");
|
||||
else if (ret == 0)
|
||||
} else if (ret == 0) {
|
||||
SPICE_DEBUG("public keys mismatch");
|
||||
else
|
||||
} else {
|
||||
SPICE_DEBUG("public keys types mismatch");
|
||||
}
|
||||
|
||||
finish:
|
||||
if (bio)
|
||||
@ -255,8 +256,9 @@ static int verify_hostname(X509* cert, const char *hostname)
|
||||
}
|
||||
}
|
||||
|
||||
if (!cn_match)
|
||||
if (!cn_match) {
|
||||
SPICE_DEBUG("warning: common name mismatch");
|
||||
}
|
||||
|
||||
return cn_match;
|
||||
}
|
||||
@ -384,10 +386,11 @@ int verify_subject(X509* cert, SpiceOpenSSLVerify* verify)
|
||||
|
||||
ret = X509_NAME_cmp(cert_subject, verify->in_subject);
|
||||
|
||||
if (ret == 0)
|
||||
if (ret == 0) {
|
||||
SPICE_DEBUG("subjects match");
|
||||
else
|
||||
} else {
|
||||
SPICE_DEBUG("subjects mismatch");
|
||||
}
|
||||
|
||||
return !ret;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user