From d0c4c442a44f85c18903b4edba9c1d726f6983c0 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 15 Apr 2013 23:06:39 +0200 Subject: [PATCH] PATCHv3 Remove unused variables or put them to the defines they are being used in Acked-by: Gert Doering Message-Id: <1366059999-31731-1-git-send-email-arne@rfc2549.org> URL: http://article.gmane.org/gmane.network.openvpn.devel/7511 Signed-off-by: Gert Doering --- src/openvpn/crypto.c | 2 -- src/openvpn/init.c | 1 - src/openvpn/misc.c | 8 -------- src/openvpn/proxy.c | 1 - src/openvpn/route.c | 1 - src/openvpn/ssl.c | 4 ---- src/openvpn/ssl_openssl.c | 2 -- src/openvpn/ssl_verify.c | 2 ++ 8 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/openvpn/crypto.c b/src/openvpn/crypto.c index d9adf5b51..c4c356dc4 100644 --- a/src/openvpn/crypto.c +++ b/src/openvpn/crypto.c @@ -1028,7 +1028,6 @@ read_passphrase_hash (const char *passphrase_file, uint8_t *output, int len) { - unsigned int outlen = 0; md_ctx_t md; ASSERT (len >= md_kt_size(digest)); @@ -1361,7 +1360,6 @@ prng_bytes (uint8_t *output, int len) const int md_size = md_kt_size (nonce_md); while (len > 0) { - unsigned int outlen = 0; const int blen = min_int (len, md_size); md_full(nonce_md, nonce_data, md_size + nonce_secret_len, nonce_data); memcpy (output, nonce_data, blen); diff --git a/src/openvpn/init.c b/src/openvpn/init.c index cf0498d4f..fb1472697 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -1205,7 +1205,6 @@ do_init_route_ipv6_list (const struct options *options, struct env_set *es) { const char *gw = NULL; - int dev = dev_type_enum (options->dev, options->dev_type); int metric = -1; /* no metric set */ gw = options->ifconfig_ipv6_remote; /* default GW = remote end */ diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c index fa327f8c7..1120adc43 100644 --- a/src/openvpn/misc.c +++ b/src/openvpn/misc.c @@ -701,14 +701,6 @@ env_set_remove_from_environment (const struct env_set *es) } } -#ifdef HAVE_PUTENV - -/* companion functions to putenv */ - -static struct env_item *global_env = NULL; /* GLOBAL */ - -#endif - /* add/modify/delete environmental strings */ void diff --git a/src/openvpn/proxy.c b/src/openvpn/proxy.c index 95d71531b..04ed421b3 100644 --- a/src/openvpn/proxy.c +++ b/src/openvpn/proxy.c @@ -439,7 +439,6 @@ struct http_proxy_info * http_proxy_new (const struct http_proxy_options *o) { struct http_proxy_info *p; - struct http_proxy_options opt; if (!o || !o->server) msg (M_FATAL, "HTTP_PROXY: server not specified"); diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 72ecbaf88..19b4bfe1d 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -2881,7 +2881,6 @@ get_default_gateway (struct route_gateway_info *rgi) { /* get interface name */ const struct sockaddr_dl *adl = (struct sockaddr_dl *) ifp; - int len = adl->sdl_nlen; if (adl->sdl_nlen && adl->sdl_nlen < sizeof(rgi->iface)) { memcpy (rgi->iface, adl->sdl_data, adl->sdl_nlen); diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index d9076f36e..736dfc95d 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -1734,7 +1734,6 @@ key_method_1_write (struct buffer *buf, struct tls_session *session) { struct key key; struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */ - struct key_state *ks_lame = &session->key[KS_LAME_DUCK]; /* retiring key */ ASSERT (session->opt->key_method == 1); ASSERT (buf_init (buf, 0)); @@ -1849,7 +1848,6 @@ static bool key_method_2_write (struct buffer *buf, struct tls_session *session) { struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */ - struct key_state *ks_lame = &session->key[KS_LAME_DUCK]; /* retiring key */ ASSERT (session->opt->key_method == 2); ASSERT (buf_init (buf, 0)); @@ -1933,7 +1931,6 @@ key_method_1_read (struct buffer *buf, struct tls_session *session) int status; struct key key; struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */ - struct key_state *ks_lame = &session->key[KS_LAME_DUCK]; /* retiring key */ ASSERT (session->opt->key_method == 1); @@ -1992,7 +1989,6 @@ static bool key_method_2_read (struct buffer *buf, struct tls_multi *multi, struct tls_session *session) { struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */ - struct key_state *ks_lame = &session->key[KS_LAME_DUCK]; /* retiring key */ int key_method_flags; bool username_status, password_status; diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c index 2e5933d61..5db717df3 100644 --- a/src/openvpn/ssl_openssl.c +++ b/src/openvpn/ssl_openssl.c @@ -490,7 +490,6 @@ tls_ctx_load_priv_file (struct tls_root_ctx *ctx, const char *priv_key_file, const char *priv_key_file_inline ) { - int status; SSL_CTX *ssl_ctx = NULL; BIO *in = NULL; EVP_PKEY *pkey = NULL; @@ -1193,7 +1192,6 @@ show_available_tls_ciphers () SSL_CTX *ctx; SSL *ssl; const char *cipher_name; - const char *print_name; const tls_cipher_name_pair *pair; int priority = 0; diff --git a/src/openvpn/ssl_verify.c b/src/openvpn/ssl_verify.c index e651a8e0f..b1bbc96f1 100644 --- a/src/openvpn/ssl_verify.c +++ b/src/openvpn/ssl_verify.c @@ -1027,7 +1027,9 @@ static int verify_user_pass_plugin (struct tls_session *session, const struct user_pass *up, const char *raw_username) { int retval = OPENVPN_PLUGIN_FUNC_ERROR; +#ifdef PLUGIN_DEF_AUTH struct key_state *ks = &session->key[KS_PRIMARY]; /* primary key */ +#endif /* Is username defined? */ if ((session->opt->ssl_flags & SSLF_AUTH_USER_PASS_OPTIONAL) || strlen (up->username)) -- 2.47.2