Deprecate BIO_sock_cleanup() and make it a no-op
authorMatt Caswell <matt@openssl.org>
Mon, 4 Apr 2016 13:53:37 +0000 (14:53 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 13 Apr 2016 07:52:33 +0000 (08:52 +0100)
BIO_sock_cleanup() 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>
crypto/bio/b_sock.c
crypto/init.c
include/internal/bio.h
include/openssl/bio.h

index 046de991900c8d15d4199566074bf6eb72e21739..e0038f01887dca6c5b66f609243de5a959e0c083 100644 (file)
@@ -205,7 +205,7 @@ int BIO_sock_init(void)
     return (1);
 }
 
-void BIO_sock_cleanup(void)
+void bio_sock_cleanup_intern(void)
 {
 # ifdef OPENSSL_SYS_WINDOWS
     if (wsa_init_done) {
index 3bfe4502ebbe7f7776c9cbbc67a264466831f24d..2d50d4deb8c1fee2c2ffebbe946995afe1d4330f 100644 (file)
@@ -59,6 +59,7 @@
 #include <internal/cryptlib_int.h>
 #include <openssl/err.h>
 #include <internal/rand.h>
+#include <internal/bio.h>
 #include <openssl/evp.h>
 #include <internal/evp_int.h>
 #include <internal/conf.h>
@@ -463,7 +464,7 @@ void OPENSSL_cleanup(void)
     fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
                     "crypto_cleanup_all_ex_data_intern()\n");
     fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
-                    "BIO_sock_cleanup()\n");
+                    "bio_sock_cleanup_intern()\n");
     fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
                     "EVP_cleanup()\n");
     fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
@@ -485,7 +486,7 @@ void OPENSSL_cleanup(void)
 #endif
     crypto_cleanup_all_ex_data_intern();
 #ifndef OPENSSL_NO_SOCK
-    BIO_sock_cleanup();
+    bio_sock_cleanup_intern();
 #endif
     EVP_cleanup();
     OBJ_cleanup();
index b3352ce80fb2e70be0436136bf3f46ccebc7fb79..bf5bc18c7a6eb198a4beee17893b668dbbd509ef 100644 (file)
@@ -67,5 +67,4 @@ struct bio_method_st {
     long (*callback_ctrl) (BIO *, int, bio_info_cb *);
 };
 
-
-
+void bio_sock_cleanup_intern(void);
index e0c6380883cee0b971c07e848157395bdefa87fe..97a3d9d46c5377d8290cf3dfe5add763957f3886 100644 (file)
@@ -695,7 +695,9 @@ int BIO_sock_error(int sock);
 int BIO_socket_ioctl(int fd, long type, void *arg);
 int BIO_socket_nbio(int fd, int mode);
 int BIO_sock_init(void);
-void BIO_sock_cleanup(void);
+#if OPENSSL_API_COMPAT < 0x10100000L
+# define BIO_sock_cleanup()
+#endif
 int BIO_set_tcp_ndelay(int sock, int turn_on);
 
 DEPRECATEDIN_1_1_0(struct hostent *BIO_gethostbyname(const char *name))