Fix SSL compression symbol exporting
authorMatt Caswell <matt@openssl.org>
Tue, 17 May 2016 08:23:36 +0000 (09:23 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 17 May 2016 08:23:36 +0000 (09:23 +0100)
Some compression related functions in libssl have dummy versions to be
used when compiled with no-comp. However those dummy functions were not
being exported on Windows so they are unusable when dynamically linked.

Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/ossl_typ.h
ssl/ssl.h
ssl/ssl_ciph.c
ssl/ssl_lib.c
util/ssleay.num

index 9144ea2cf60b3a287f2b59f1d26678e750987d0f..364d26238e8c4def0a98cf82d0ccdb7c2e59d7ed 100644 (file)
@@ -178,6 +178,8 @@ typedef struct engine_st ENGINE;
 typedef struct ssl_st SSL;
 typedef struct ssl_ctx_st SSL_CTX;
 
+typedef struct comp_method_st COMP_METHOD;
+
 typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
 typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
 typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
index 5ef56faa509903c771a42acfbf7443ea7ae54687..028681a0cbb4ea5edcfaa1e04f484c4942913df8 100644 (file)
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -2532,7 +2532,6 @@ void SSL_set_tmp_ecdh_callback(SSL *ssl,
                                                 int keylength));
 # endif
 
-# ifndef OPENSSL_NO_COMP
 const COMP_METHOD *SSL_get_current_compression(SSL *s);
 const COMP_METHOD *SSL_get_current_expansion(SSL *s);
 const char *SSL_COMP_get_name(const COMP_METHOD *comp);
@@ -2541,13 +2540,6 @@ STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP)
                                                       *meths);
 void SSL_COMP_free_compression_methods(void);
 int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);
-# else
-const void *SSL_get_current_compression(SSL *s);
-const void *SSL_get_current_expansion(SSL *s);
-const char *SSL_COMP_get_name(const void *comp);
-void *SSL_COMP_get_compression_methods(void);
-int SSL_COMP_add_compression_method(int id, void *cm);
-# endif
 
 const SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr);
 
index 302464e643ea7ac2f6e412becf4f69b4c525606d..d500dac41496cfb15f632415f866bcc505ac70bf 100644 (file)
@@ -1932,17 +1932,27 @@ SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n)
 }
 
 #ifdef OPENSSL_NO_COMP
-void *SSL_COMP_get_compression_methods(void)
+STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void)
 {
     return NULL;
 }
 
-int SSL_COMP_add_compression_method(int id, void *cm)
+STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP)
+                                                      *meths)
+{
+    return NULL;
+}
+
+void SSL_COMP_free_compression_methods(void)
+{
+}
+
+int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
 {
     return 1;
 }
 
-const char *SSL_COMP_get_name(const void *comp)
+const char *SSL_COMP_get_name(const COMP_METHOD *comp)
 {
     return NULL;
 }
index fd94325bb3a47d25033f3f3faee7eaa9c01bd8ac..714a31ec3848dbc10cf3aee90670573d4bd438f2 100644 (file)
@@ -3050,12 +3050,12 @@ const SSL_CIPHER *SSL_get_current_cipher(const SSL *s)
 }
 
 #ifdef OPENSSL_NO_COMP
-const void *SSL_get_current_compression(SSL *s)
+const COMP_METHOD *SSL_get_current_compression(SSL *s)
 {
     return NULL;
 }
 
-const void *SSL_get_current_expansion(SSL *s)
+const COMP_METHOD *SSL_get_current_expansion(SSL *s)
 {
     return NULL;
 }
index 5760bc42a2519b9359db7468586d1c5a423cfd2b..e3fdaf2d0a545759dd8758faa7cf588d40182dbd 100755 (executable)
@@ -164,7 +164,7 @@ SSL_CTX_get_cert_store                  180 EXIST::FUNCTION:
 SSL_CTX_set_cert_store                  181    EXIST::FUNCTION:
 SSL_want                                182    EXIST::FUNCTION:
 SSL_library_init                        183    EXIST::FUNCTION:
-SSL_COMP_add_compression_method         184    EXIST::FUNCTION:COMP
+SSL_COMP_add_compression_method         184    EXIST::FUNCTION:
 SSL_add_file_cert_subjects_to_stack     185    EXIST:!VMS:FUNCTION:STDIO
 SSL_add_file_cert_subjs_to_stk          185    EXIST:VMS:FUNCTION:STDIO
 SSL_set_tmp_rsa_callback                186    EXIST::FUNCTION:RSA
@@ -219,13 +219,13 @@ SSL_set_msg_callback                    267       EXIST::FUNCTION:
 DTLSv1_client_method                    268    EXIST::FUNCTION:
 SSL_CTX_set_tmp_ecdh_callback           269    EXIST::FUNCTION:ECDH
 SSL_set_tmp_ecdh_callback               270    EXIST::FUNCTION:ECDH
-SSL_COMP_get_name                       271    EXIST::FUNCTION:COMP
-SSL_get_current_compression             272    EXIST::FUNCTION:COMP
+SSL_COMP_get_name                       271    EXIST::FUNCTION:
+SSL_get_current_compression             272    EXIST::FUNCTION:
 DTLSv1_method                           273    EXIST::FUNCTION:
-SSL_get_current_expansion               274    EXIST::FUNCTION:COMP
+SSL_get_current_expansion               274    EXIST::FUNCTION:
 DTLSv1_server_method                    275    EXIST::FUNCTION:
-SSL_COMP_get_compression_methods        276    EXIST:!VMS:FUNCTION:COMP
-SSL_COMP_get_compress_methods           276    EXIST:VMS:FUNCTION:COMP
+SSL_COMP_get_compression_methods        276    EXIST:!VMS:FUNCTION:
+SSL_COMP_get_compress_methods           276    EXIST:VMS:FUNCTION:
 SSL_SESSION_get_id                      277    EXIST::FUNCTION:
 SSL_CTX_sess_set_new_cb                 278    EXIST::FUNCTION:
 SSL_CTX_sess_get_get_cb                 279    EXIST::FUNCTION:
@@ -332,8 +332,8 @@ SSL_set_alpn_protos                     370 EXIST::FUNCTION:
 SSL_CTX_set_srv_supp_data               371    NOEXIST::FUNCTION:
 SSL_CONF_cmd_argv                       372    EXIST::FUNCTION:
 DTLSv1_2_server_method                  373    EXIST::FUNCTION:
-SSL_COMP_set0_compression_methods       374    EXIST:!VMS:FUNCTION:COMP
-SSL_COMP_set0_compress_methods          374    EXIST:VMS:FUNCTION:COMP
+SSL_COMP_set0_compression_methods       374    EXIST:!VMS:FUNCTION:
+SSL_COMP_set0_compress_methods          374    EXIST:VMS:FUNCTION:
 SSL_CTX_set_cert_cb                     375    EXIST::FUNCTION:
 SSL_CTX_add_client_custom_ext           376    EXIST::FUNCTION:TLSEXT
 SSL_is_server                           377    EXIST::FUNCTION:
@@ -365,6 +365,6 @@ SSL_CTX_set_cli_supp_data               403 NOEXIST::FUNCTION:
 DTLSv1_2_method                         404    EXIST::FUNCTION:
 DTLS_server_method                      405    EXIST::FUNCTION:
 SSL_CTX_use_serverinfo_file             406    EXIST::FUNCTION:STDIO,TLSEXT
-SSL_COMP_free_compression_methods       407    EXIST:!VMS:FUNCTION:COMP
-SSL_COMP_free_compress_methods          407    EXIST:VMS:FUNCTION:COMP
+SSL_COMP_free_compression_methods       407    EXIST:!VMS:FUNCTION:
+SSL_COMP_free_compress_methods          407    EXIST:VMS:FUNCTION:
 SSL_extension_supported                 409    EXIST::FUNCTION:TLSEXT