Deprecate SSL_COMP_free_compression_methods() and make it a no-op
authorMatt Caswell <matt@openssl.org>
Mon, 4 Apr 2016 12:53:35 +0000 (13:53 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 13 Apr 2016 07:52:33 +0000 (08:52 +0100)
SSL_COMP_free_compression_methods() should not be called expicitly - we
should leave auto-deinit to clean this up instead.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
doc/ssl/SSL_COMP_add_compression_method.pod
include/openssl/ssl.h
ssl/ssl_ciph.c
ssl/ssl_init.c
ssl/ssl_locl.h

index 6a0caff..b08a424 100644 (file)
@@ -10,7 +10,11 @@ SSL_COMP_add_compression_method, SSL_COMP_free_compression_methods - handle SSL/
 
  int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);
 
 
  int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);
 
- +void SSL_COMP_free_compression_methods(void);
+Deprecated:
+
+ #if OPENSSL_API_COMPAT < 0x10100000L
+ # define SSL_COMP_free_compression_methods()
+ #endif
 
 =head1 DESCRIPTION
 
 
 =head1 DESCRIPTION
 
@@ -19,9 +23,12 @@ the identifier B<id> to the list of available compression methods. This
 list is globally maintained for all SSL operations within this application.
 It cannot be set for specific SSL_CTX or SSL objects.
 
 list is globally maintained for all SSL operations within this application.
 It cannot be set for specific SSL_CTX or SSL objects.
 
-SSL_COMP_free_compression_methods() frees the internal table of
-compression methods that were built internally, and possibly
-augmented by adding SSL_COMP_add_compression_method().
+In versions of OpenSSL prior to 1.1.0 SSL_COMP_free_compression_methods() freed
+the internal table of compression methods that were built internally, and
+possibly augmented by adding SSL_COMP_add_compression_method(). However this is
+now unncessary from version 1.1.0.  No explicit initialisation or
+de-initialisation is necessary. See L<OPENSSL_init_crypto(3)> and
+L<OPENSSL_init_ssl(3)>. From OpenSSL 1.1.0 calling this function does nothing.
 
 =head1 NOTES
 
 
 =head1 NOTES
 
@@ -73,4 +80,8 @@ The operation failed. Check the error queue to find out the reason.
 
 L<ssl(3)>
 
 
 L<ssl(3)>
 
+=head1 HISTORY
+
+SSL_COMP_free_compression_methods() was deprecated in OpenSSL 1.1.0.
+
 =cut
 =cut
index b085c9e..6b66407 100644 (file)
@@ -1835,7 +1835,9 @@ __owur const char *SSL_COMP_get_name(const COMP_METHOD *comp);
 STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void);
 __owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP)
                                                       *meths);
 STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void);
 __owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP)
                                                       *meths);
-void SSL_COMP_free_compression_methods(void);
+#if OPENSSL_API_COMPAT < 0x10100000L
+# define SSL_COMP_free_compression_methods()
+#endif
 __owur int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);
 
 const SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr);
 __owur int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);
 
 const SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr);
index 46fa3e8..1faa2ea 100644 (file)
@@ -1883,9 +1883,6 @@ STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP)
 {
     return meths;
 }
 {
     return meths;
 }
-void SSL_COMP_free_compression_methods(void)
-{
-}
 int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
 {
     return 1;
 int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
 {
     return 1;
@@ -1911,7 +1908,7 @@ static void cmeth_free(SSL_COMP *cm)
     OPENSSL_free(cm);
 }
 
     OPENSSL_free(cm);
 }
 
-void SSL_COMP_free_compression_methods(void)
+void ssl_comp_free_compression_methods_intern(void)
 {
     STACK_OF(SSL_COMP) *old_meths = ssl_comp_methods;
     ssl_comp_methods = NULL;
 {
     STACK_OF(SSL_COMP) *old_meths = ssl_comp_methods;
     ssl_comp_methods = NULL;
index 2462fa5..2f8034a 100644 (file)
@@ -198,9 +198,9 @@ static void ssl_library_stop(void)
 #ifndef OPENSSL_NO_COMP
 #ifdef OPENSSL_INIT_DEBUG
         fprintf(stderr, "OPENSSL_INIT: ssl_library_stop: "
 #ifndef OPENSSL_NO_COMP
 #ifdef OPENSSL_INIT_DEBUG
         fprintf(stderr, "OPENSSL_INIT: ssl_library_stop: "
-                        "SSL_COMP_free_compression_methods()\n");
+                        "ssl_comp_free_compression_methods_intern()\n");
 #endif
 #endif
-        SSL_COMP_free_compression_methods();
+        ssl_comp_free_compression_methods_intern();
 #endif
     }
 
 #endif
     }
 
index c02dbbb..1596091 100644 (file)
@@ -2195,6 +2195,8 @@ __owur int custom_ext_add(SSL *s, int server,
 __owur int custom_exts_copy(custom_ext_methods *dst, const custom_ext_methods *src);
 void custom_exts_free(custom_ext_methods *exts);
 
 __owur int custom_exts_copy(custom_ext_methods *dst, const custom_ext_methods *src);
 void custom_exts_free(custom_ext_methods *exts);
 
+void ssl_comp_free_compression_methods_intern(void);
+
 # else
 
 #  define ssl_init_wbio_buffer SSL_test_functions()->p_ssl_init_wbio_buffer
 # else
 
 #  define ssl_init_wbio_buffer SSL_test_functions()->p_ssl_init_wbio_buffer