xref: /freebsd/crypto/openssl/doc/man3/SSL_COMP_add_compression_method.pod (revision e7be843b4a162e68651d3911f0357ed464915629)
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
18b077aed3SPierre ProncheryThe following function has been deprecated since OpenSSL 1.1.0, and can be
19b077aed3SPierre Proncheryhidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
20b077aed3SPierre Proncherysee L<openssl_user_macros(7)>:
21e71b7053SJung-uk Kim
22b077aed3SPierre 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
63*e7be843bSPierre Proncheryfollowing compression methods available:
64*e7be843bSPierre Pronchery
65*e7be843bSPierre Pronchery=over 4
66*e7be843bSPierre Pronchery
67*e7be843bSPierre Pronchery=item COMP_zlib()
68*e7be843bSPierre Pronchery
69*e7be843bSPierre Pronchery=item COMP_brotli()
70*e7be843bSPierre Pronchery
71*e7be843bSPierre Pronchery=item COMP_brotli_oneshot()
72*e7be843bSPierre Pronchery
73*e7be843bSPierre Pronchery=item COMP_zstd()
74*e7be843bSPierre Pronchery
75*e7be843bSPierre Pronchery=item COMP_zstd_oneshot()
76*e7be843bSPierre Pronchery
77*e7be843bSPierre Pronchery=back
78e71b7053SJung-uk Kim
79e71b7053SJung-uk Kim=head1 RETURN VALUES
80e71b7053SJung-uk Kim
81e71b7053SJung-uk KimSSL_COMP_add_compression_method() may return the following values:
82e71b7053SJung-uk Kim
83e71b7053SJung-uk Kim=over 4
84e71b7053SJung-uk Kim
85e71b7053SJung-uk Kim=item Z<>0
86e71b7053SJung-uk Kim
87e71b7053SJung-uk KimThe operation succeeded.
88e71b7053SJung-uk Kim
89e71b7053SJung-uk Kim=item Z<>1
90e71b7053SJung-uk Kim
91e71b7053SJung-uk KimThe operation failed. Check the error queue to find out the reason.
92e71b7053SJung-uk Kim
93e71b7053SJung-uk Kim=back
94e71b7053SJung-uk Kim
95e71b7053SJung-uk KimSSL_COMP_get_compression_methods() returns the stack of compressions methods or
96e71b7053SJung-uk KimNULL on error.
97e71b7053SJung-uk Kim
98e71b7053SJung-uk KimSSL_COMP_get0_name() returns the name of the compression method or NULL on error.
99e71b7053SJung-uk Kim
100e71b7053SJung-uk KimSSL_COMP_get_id() returns the name of the compression method or -1 on error.
101e71b7053SJung-uk Kim
102e71b7053SJung-uk Kim=head1 SEE ALSO
103e71b7053SJung-uk Kim
104e71b7053SJung-uk KimL<ssl(7)>
105e71b7053SJung-uk Kim
106e71b7053SJung-uk Kim=head1 HISTORY
107e71b7053SJung-uk Kim
1086935a639SJung-uk KimThe SSL_COMP_free_compression_methods() function was deprecated in OpenSSL 1.1.0.
1096935a639SJung-uk KimThe SSL_COMP_get0_name() and SSL_comp_get_id() functions were added in OpenSSL 1.1.0d.
110e71b7053SJung-uk Kim
111e71b7053SJung-uk Kim=head1 COPYRIGHT
112e71b7053SJung-uk Kim
113*e7be843bSPierre ProncheryCopyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
114e71b7053SJung-uk Kim
115b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
116e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
117e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
118e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
119e71b7053SJung-uk Kim
120e71b7053SJung-uk Kim=cut
121