mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-11 03:10:40 +03:00
coap_gnutls.c: Removed dead code
Coverity found that status is always 0 when validate_cn_call_back() is invoked (CID 1476517). This change removes the dead code by introducing a constant that can be inferred at compile-time.
This commit is contained in:
1 parent
db24e760e0
commit
33b372d945
1 file changed
+4
-1
+4
-1
@@ -532,6 +532,9 @@ static int cert_verify_gnutls(gnutls_session_t g_session)
|
||||
gnutls_x509_crt_t cert;
|
||||
uint8_t der[2048];
|
||||
size_t size;
|
||||
/* status == 0 indicates that the certificate passed to
|
||||
* setup_data.validate_cn_call_back has been validated. */
|
||||
const int cert_is_trusted = !status;
|
||||
|
||||
cert_list = gnutls_certificate_get_peers(g_session, &cert_list_size);
|
||||
if (cert_list_size == 0) {
|
||||
@@ -554,7 +557,7 @@ static int cert_verify_gnutls(gnutls_session_t g_session)
|
||||
size,
|
||||
c_session,
|
||||
0,
|
||||
status ? 0 : 1,
|
||||
cert_is_trusted,
|
||||
g_context->setup_data.cn_call_back_arg)) {
|
||||
alert = GNUTLS_A_ACCESS_DENIED;
|
||||
goto fail;
|
||||
|
||||
Reference in new issue
Block a user