From 60ced074c48fa265b3eccf91a89dec374b4c7e49 Mon Sep 17 00:00:00 2001 From: Cristian Stoica Date: Wed, 29 Jun 2016 18:34:33 +0300 Subject: [PATCH] fix warning unused-but-set-variable 'alg_k' (no-dh and no-ec) This patch fixes the following warning when OpenSSL is configured with no-dh and no-ec: ./Configure no-ec no-dh linux-x86_64 ... s3_lib.c: In function 'ssl3_get_req_cert_type': s3_lib.c:4234:19: warning: variable 'alg_k' set but not used [-Wunused-but-set-variable] unsigned long alg_k; CLA: trivial Signed-off-by: Cristian Stoica Reviewed-by: Rich Salz Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/6087) --- ssl/s3_lib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 45b84a86e5..633c95486e 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -4231,7 +4231,10 @@ int ssl3_get_req_cert_type(SSL *s, unsigned char *p) #if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_ECDH) int nostrict = 1; #endif +#if !defined(OPENSSL_NO_GOST) || !defined(OPENSSL_NO_DH) || \ + !defined(OPENSSL_NO_ECDH) unsigned long alg_k; +#endif /* If we have custom certificate types set, use them */ if (s->cert->ctypes) { @@ -4261,7 +4264,10 @@ int ssl3_get_req_cert_type(SSL *s, unsigned char *p) } } +#if !defined(OPENSSL_NO_GOST) || !defined(OPENSSL_NO_DH) || \ + !defined(OPENSSL_NO_ECDH) alg_k = s->s3->tmp.new_cipher->algorithm_mkey; +#endif #ifndef OPENSSL_NO_GOST if (s->version >= TLS1_VERSION) { -- 2.25.1