fix warning unused-but-set-variable 'alg_k' (no-dh and no-ec)
authorCristian Stoica <cristian.stoica@nxp.com>
Wed, 29 Jun 2016 15:34:33 +0000 (18:34 +0300)
committerRichard Levitte <levitte@openssl.org>
Fri, 27 Apr 2018 04:00:10 +0000 (06:00 +0200)
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 <cristian.stoica@nxp.com>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6087)

ssl/s3_lib.c

index 45b84a86e586b5465e4d17dbda21e72f4278e7fc..633c95486e95f72eabc09f6dd508e5ad971aacf5 100644 (file)
@@ -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) {