Made it an error to define OPENSSL_USE_DEPRECATED if OpenSSL has been built
authorMatt Caswell <matt@openssl.org>
Thu, 18 Dec 2014 15:03:09 +0000 (15:03 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 18 Dec 2014 19:57:44 +0000 (19:57 +0000)
with OPENSSL_NO_DEPRECATED defined

Reviewed-by: Rich Salz <rsalz@openssl.org>
Configure
crypto/opensslconf.h.in

index 139dbf0a0ccc7dabce846b486cfe9c1ee5d1cab3..b97f9617db2d9afc17beaba03b957a87d273423a 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1419,8 +1419,11 @@ if ($zlib)
                }
        }
 
-#Always build the library with OPENSSL_USE_DEPRECATED. This is overridden by OPENSSL_NO_DEPRECATED
-$cflags = "-DOPENSSL_USE_DEPRECATED $cflags";
+#Build the library with OPENSSL_USE_DEPRECATED if deprecation is not disabled
+if(!defined($disabled{"deprecated"}))
+       {
+       $cflags = "-DOPENSSL_USE_DEPRECATED $cflags";
+       }
 
 # You will find shlib_mark1 and shlib_mark2 explained in Makefile.org
 my $shared_mark = "";
index 31a01c1c8bd0a2b5c902130d0e7d8ffd717f820f..faa33a496d3b4c557c3163848c68716204e54828 100644 (file)
@@ -6,7 +6,7 @@
  * deprecated functions then this will not work
  */
 #if defined(OPENSSL_NO_DEPRECATED) && defined(OPENSSL_USE_DEPRECATED)
-#undef OPENSSL_USE_DEPRECATED
+#error "OPENSSL_USE_DEPRECATED has been defined, but OpenSSL has been built without support for deprecated functions"
 #endif
 
 /* Test for support for deprecated attribute */