fix warning unused-but-set-variable 'nostrict' (no-dh and no-ec)
authorCristian Stoica <cristian.stoica@nxp.com>
Wed, 29 Jun 2016 15:30:58 +0000 (18:30 +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:4231:9: warning: variable 'nostrict' set but not used [-Wunused-but-set-variable]
     int nostrict = 1;
         ^

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 7e27dae35b0c25f177d4ea9c47ace4d6e24f23f8..45b84a86e586b5465e4d17dbda21e72f4278e7fc 100644 (file)
@@ -4228,7 +4228,9 @@ int ssl3_get_req_cert_type(SSL *s, unsigned char *p)
 #ifndef OPENSSL_NO_ECDSA
     int have_ecdsa_sign = 0;
 #endif
+#if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_ECDH)
     int nostrict = 1;
+#endif
     unsigned long alg_k;
 
     /* If we have custom certificate types set, use them */
@@ -4238,8 +4240,10 @@ int ssl3_get_req_cert_type(SSL *s, unsigned char *p)
     }
     /* get configured sigalgs */
     siglen = tls12_get_psigalgs(s, 1, &sig);
+#if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_ECDH)
     if (s->cert->cert_flags & SSL_CERT_FLAGS_CHECK_TLS_STRICT)
         nostrict = 0;
+#endif
     for (i = 0; i < siglen; i += 2, sig += 2) {
         switch (sig[1]) {
         case TLSEXT_signature_rsa: