1e71b7053SJung-uk Kim=pod 2e71b7053SJung-uk Kim 3e71b7053SJung-uk Kim=head1 NAME 4e71b7053SJung-uk Kim 5e71b7053SJung-uk KimSSL_COMP_add_compression_method, SSL_COMP_get_compression_methods, 6e71b7053SJung-uk KimSSL_COMP_get0_name, SSL_COMP_get_id, SSL_COMP_free_compression_methods 7e71b7053SJung-uk Kim- handle SSL/TLS integrated compression methods 8e71b7053SJung-uk Kim 9e71b7053SJung-uk Kim=head1 SYNOPSIS 10e71b7053SJung-uk Kim 11e71b7053SJung-uk Kim #include <openssl/ssl.h> 12e71b7053SJung-uk Kim 13e71b7053SJung-uk Kim int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm); 14e71b7053SJung-uk Kim STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); 15e71b7053SJung-uk Kim const char *SSL_COMP_get0_name(const SSL_COMP *comp); 16e71b7053SJung-uk Kim int SSL_COMP_get_id(const SSL_COMP *comp); 17e71b7053SJung-uk Kim 18*b077aed3SPierre ProncheryThe following function has been deprecated since OpenSSL 1.1.0, and can be 19*b077aed3SPierre Proncheryhidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value, 20*b077aed3SPierre Proncherysee L<openssl_user_macros(7)>: 21e71b7053SJung-uk Kim 22*b077aed3SPierre Pronchery void SSL_COMP_free_compression_methods(void); 23e71b7053SJung-uk Kim 24e71b7053SJung-uk Kim=head1 DESCRIPTION 25e71b7053SJung-uk Kim 26e71b7053SJung-uk KimSSL_COMP_add_compression_method() adds the compression method B<cm> with 27e71b7053SJung-uk Kimthe identifier B<id> to the list of available compression methods. This 28e71b7053SJung-uk Kimlist is globally maintained for all SSL operations within this application. 29e71b7053SJung-uk KimIt cannot be set for specific SSL_CTX or SSL objects. 30e71b7053SJung-uk Kim 31e71b7053SJung-uk KimSSL_COMP_get_compression_methods() returns a stack of all of the available 32e71b7053SJung-uk Kimcompression methods or NULL on error. 33e71b7053SJung-uk Kim 34e71b7053SJung-uk KimSSL_COMP_get0_name() returns the name of the compression method B<comp>. 35e71b7053SJung-uk Kim 36e71b7053SJung-uk KimSSL_COMP_get_id() returns the id of the compression method B<comp>. 37e71b7053SJung-uk Kim 38e71b7053SJung-uk KimSSL_COMP_free_compression_methods() releases any resources acquired to 39e71b7053SJung-uk Kimmaintain the internal table of compression methods. 40e71b7053SJung-uk Kim 41e71b7053SJung-uk Kim=head1 NOTES 42e71b7053SJung-uk Kim 43e71b7053SJung-uk KimThe TLS standard (or SSLv3) allows the integration of compression methods 44e71b7053SJung-uk Kiminto the communication. The TLS RFC does however not specify compression 45e71b7053SJung-uk Kimmethods or their corresponding identifiers, so there is currently no compatible 46e71b7053SJung-uk Kimway to integrate compression with unknown peers. It is therefore currently not 47e71b7053SJung-uk Kimrecommended to integrate compression into applications. Applications for 48e71b7053SJung-uk Kimnon-public use may agree on certain compression methods. Using different 49e71b7053SJung-uk Kimcompression methods with the same identifier will lead to connection failure. 50e71b7053SJung-uk Kim 51e71b7053SJung-uk KimAn OpenSSL client speaking a protocol that allows compression (SSLv3, TLSv1) 52e71b7053SJung-uk Kimwill unconditionally send the list of all compression methods enabled with 53e71b7053SJung-uk KimSSL_COMP_add_compression_method() to the server during the handshake. 54e71b7053SJung-uk KimUnlike the mechanisms to set a cipher list, there is no method available to 55e71b7053SJung-uk Kimrestrict the list of compression method on a per connection basis. 56e71b7053SJung-uk Kim 57e71b7053SJung-uk KimAn OpenSSL server will match the identifiers listed by a client against 58e71b7053SJung-uk Kimits own compression methods and will unconditionally activate compression 59e71b7053SJung-uk Kimwhen a matching identifier is found. There is no way to restrict the list 60e71b7053SJung-uk Kimof compression methods supported on a per connection basis. 61e71b7053SJung-uk Kim 62e71b7053SJung-uk KimIf enabled during compilation, the OpenSSL library will have the 63e71b7053SJung-uk KimCOMP_zlib() compression method available. 64e71b7053SJung-uk Kim 65e71b7053SJung-uk Kim=head1 RETURN VALUES 66e71b7053SJung-uk Kim 67e71b7053SJung-uk KimSSL_COMP_add_compression_method() may return the following values: 68e71b7053SJung-uk Kim 69e71b7053SJung-uk Kim=over 4 70e71b7053SJung-uk Kim 71e71b7053SJung-uk Kim=item Z<>0 72e71b7053SJung-uk Kim 73e71b7053SJung-uk KimThe operation succeeded. 74e71b7053SJung-uk Kim 75e71b7053SJung-uk Kim=item Z<>1 76e71b7053SJung-uk Kim 77e71b7053SJung-uk KimThe operation failed. Check the error queue to find out the reason. 78e71b7053SJung-uk Kim 79e71b7053SJung-uk Kim=back 80e71b7053SJung-uk Kim 81e71b7053SJung-uk KimSSL_COMP_get_compression_methods() returns the stack of compressions methods or 82e71b7053SJung-uk KimNULL on error. 83e71b7053SJung-uk Kim 84e71b7053SJung-uk KimSSL_COMP_get0_name() returns the name of the compression method or NULL on error. 85e71b7053SJung-uk Kim 86e71b7053SJung-uk KimSSL_COMP_get_id() returns the name of the compression method or -1 on error. 87e71b7053SJung-uk Kim 88e71b7053SJung-uk Kim=head1 SEE ALSO 89e71b7053SJung-uk Kim 90e71b7053SJung-uk KimL<ssl(7)> 91e71b7053SJung-uk Kim 92e71b7053SJung-uk Kim=head1 HISTORY 93e71b7053SJung-uk Kim 946935a639SJung-uk KimThe SSL_COMP_free_compression_methods() function was deprecated in OpenSSL 1.1.0. 956935a639SJung-uk KimThe SSL_COMP_get0_name() and SSL_comp_get_id() functions were added in OpenSSL 1.1.0d. 96e71b7053SJung-uk Kim 97e71b7053SJung-uk Kim=head1 COPYRIGHT 98e71b7053SJung-uk Kim 99*b077aed3SPierre ProncheryCopyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved. 100e71b7053SJung-uk Kim 101*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 102e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 103e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 104e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 105e71b7053SJung-uk Kim 106e71b7053SJung-uk Kim=cut 107