diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-02-20 15:05:57 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-02-20 18:52:20 +0100 |
commit | b0521c86ff59745253d818505b28808919a46e07 (patch) | |
tree | 734a53a77f1c3584053fae5c86b0bc3520ea1ffe | |
parent | 0bafa12e1b4e8c97432e0f153e5fcea1bef29b71 (diff) | |
download | gnutls-b0521c86ff59745253d818505b28808919a46e07.tar.gz |
eliminated dead code as indicated by clang scan-build
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | lib/auth/ecdhe.c | 5 | ||||
-rw-r--r-- | lib/cipher.c | 4 | ||||
-rw-r--r-- | lib/ext/alpn.c | 2 | ||||
-rw-r--r-- | lib/nettle/pk.c | 1 | ||||
-rw-r--r-- | lib/opencdk/read-packet.c | 1 | ||||
-rw-r--r-- | lib/str-iconv.c | 1 | ||||
-rw-r--r-- | lib/tls-sig.c | 1 | ||||
-rw-r--r-- | lib/x509/privkey_openssl.c | 1 | ||||
-rw-r--r-- | lib/x509/x509_ext.c | 1 |
9 files changed, 6 insertions, 11 deletions
diff --git a/lib/auth/ecdhe.c b/lib/auth/ecdhe.c index 909e472dc0..f35c7e32dc 100644 --- a/lib/auth/ecdhe.c +++ b/lib/auth/ecdhe.c @@ -245,7 +245,6 @@ _gnutls_gen_ecdh_common_client_kx_int(gnutls_session_t session, if (ret < 0) return gnutls_assert_val(ret); - ret = GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER; if (pk == GNUTLS_PK_EC) { ret = _gnutls_ecc_ansi_x963_export(curve, @@ -430,7 +429,6 @@ int _gnutls_ecdh_common_print_server_kx(gnutls_session_t session, if (ret < 0) return gnutls_assert_val(ret); - ret = GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER; if (pk == GNUTLS_PK_EC) { ret = _gnutls_ecc_ansi_x963_export(curve, @@ -456,8 +454,11 @@ int _gnutls_ecdh_common_print_server_kx(gnutls_session_t session, session->key.ecdh_params.raw_pub.size); if (ret < 0) return gnutls_assert_val(ret); + } else { + return gnutls_assert_val(GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER); } + return data->length; } diff --git a/lib/cipher.c b/lib/cipher.c index 6f92333d94..800104d9ca 100644 --- a/lib/cipher.c +++ b/lib/cipher.c @@ -366,7 +366,7 @@ compressed_to_ciphertext(gnutls_session_t session, cipher_state, data_ptr, blocksize); - data_ptr += blocksize; + /*data_ptr += blocksize;*/ cipher_data += blocksize; } } else { /* AEAD */ @@ -392,7 +392,7 @@ compressed_to_ciphertext(gnutls_session_t session, memcpy(data_ptr, &nonce[imp_iv_size], exp_iv_size); - data_ptr += exp_iv_size; + /*data_ptr += exp_iv_size;*/ cipher_data += exp_iv_size; } else { /* XOR nonce with IV */ if (unlikely(params->write.IV.size != 12 || imp_iv_size != 12 || exp_iv_size != 0)) diff --git a/lib/ext/alpn.c b/lib/ext/alpn.c index b77fdc40aa..88752702a6 100644 --- a/lib/ext/alpn.c +++ b/lib/ext/alpn.c @@ -123,7 +123,7 @@ _gnutls_alpn_recv_params(gnutls_session_t session, break; } } - p += len1; + /*p += len1;*/ } if (priv->selected_protocol == NULL diff --git a/lib/nettle/pk.c b/lib/nettle/pk.c index 3850d8cd81..7a29d4cc9a 100644 --- a/lib/nettle/pk.c +++ b/lib/nettle/pk.c @@ -913,7 +913,6 @@ wrap_nettle_pk_generate_params(gnutls_pk_algorithm_t algo, } case GNUTLS_PK_RSA: case GNUTLS_PK_EC: - ret = 0; break; default: gnutls_assert(); diff --git a/lib/opencdk/read-packet.c b/lib/opencdk/read-packet.c index 202fdee4f7..f5b180b072 100644 --- a/lib/opencdk/read-packet.c +++ b/lib/opencdk/read-packet.c @@ -1016,7 +1016,6 @@ cdk_error_t cdk_pkt_read(cdk_stream_t inp, cdk_packet_t pkt) pkt->pktsize = pktsize + pktlen; pkt->old_ctb = is_newctb ? 0 : 1; - rc = 0; switch (pkt->pkttype) { case CDK_PKT_ATTRIBUTE: #define NAME_SIZE (pkt->pktlen + 16 + 1) diff --git a/lib/str-iconv.c b/lib/str-iconv.c index fdc5738d6c..67f4d3ff35 100644 --- a/lib/str-iconv.c +++ b/lib/str-iconv.c @@ -130,7 +130,6 @@ int _gnutls_utf8_to_ucs2(const void *data, size_t size, if (size == 0) return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST); - dstlen = 0; tmp_dst = u8_to_u16(data, size, NULL, &tmp_size); if (tmp_dst == NULL) return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR); diff --git a/lib/tls-sig.c b/lib/tls-sig.c index 76be441afb..a68176c0d5 100644 --- a/lib/tls-sig.c +++ b/lib/tls-sig.c @@ -252,7 +252,6 @@ _gnutls_handshake_verify_data(gnutls_session_t session, if (ret < 0) return gnutls_assert_val(ret); - pk_algo = gnutls_sign_get_pk_algorithm(sign_algo); hash_algo = gnutls_sign_get_hash_algorithm(sign_algo); } else { pk_algo = gnutls_pubkey_get_pk_algorithm(cert->pubkey, NULL); diff --git a/lib/x509/privkey_openssl.c b/lib/x509/privkey_openssl.c index c611fe8f48..1e826ed68e 100644 --- a/lib/x509/privkey_openssl.c +++ b/lib/x509/privkey_openssl.c @@ -240,7 +240,6 @@ gnutls_x509_privkey_import_openssl(gnutls_x509_privkey_t key, goto out_b64; } - ret = GNUTLS_E_MEMORY_ERROR; enc_key.size = gnutls_cipher_get_key_size(cipher); enc_key.data = gnutls_malloc(enc_key.size); if (!enc_key.data) { diff --git a/lib/x509/x509_ext.c b/lib/x509/x509_ext.c index d06a38cc75..cd48bd903a 100644 --- a/lib/x509/x509_ext.c +++ b/lib/x509/x509_ext.c @@ -3025,7 +3025,6 @@ int gnutls_x509_ext_import_key_purposes(const gnutls_datum_t * ext, ret = _gnutls_x509_read_value(c2, tmpstr, &oid); if (ret == GNUTLS_E_ASN1_ELEMENT_NOT_FOUND) { - ret = 0; break; } |