summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/Makefile8
-rw-r--r--src/lib/libcrypto/Symbols.list8
-rw-r--r--src/lib/libcrypto/Symbols.namespace8
-rw-r--r--src/lib/libcrypto/comp/c_rle.c172
-rw-r--r--src/lib/libcrypto/comp/c_zlib.c146
-rw-r--r--src/lib/libcrypto/comp/comp.h153
-rw-r--r--src/lib/libcrypto/comp/comp_err.c95
-rw-r--r--src/lib/libcrypto/comp/comp_lib.c188
-rw-r--r--src/lib/libcrypto/comp/comp_local.h148
-rw-r--r--src/lib/libcrypto/hidden/openssl/comp.h37
10 files changed, 5 insertions, 958 deletions
diff --git a/src/lib/libcrypto/Makefile b/src/lib/libcrypto/Makefile
index 5018157934..abcd91d0ef 100644
--- a/src/lib/libcrypto/Makefile
+++ b/src/lib/libcrypto/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.143 2023/07/28 09:22:26 tb Exp $ 1# $OpenBSD: Makefile,v 1.144 2023/07/28 09:42:44 tb Exp $
2 2
3LIB= crypto 3LIB= crypto
4LIBREBUILD=y 4LIBREBUILD=y
@@ -249,12 +249,6 @@ SRCS+= cms_pwri.c
249SRCS+= cms_sd.c 249SRCS+= cms_sd.c
250SRCS+= cms_smime.c 250SRCS+= cms_smime.c
251 251
252# comp/
253SRCS+= c_rle.c
254SRCS+= c_zlib.c
255SRCS+= comp_err.c
256SRCS+= comp_lib.c
257
258# conf/ 252# conf/
259SRCS+= conf_api.c 253SRCS+= conf_api.c
260SRCS+= conf_def.c 254SRCS+= conf_def.c
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list
index c16a178cf7..b6ee286c6f 100644
--- a/src/lib/libcrypto/Symbols.list
+++ b/src/lib/libcrypto/Symbols.list
@@ -661,13 +661,6 @@ CMS_unsigned_get_attr_by_OBJ
661CMS_unsigned_get_attr_count 661CMS_unsigned_get_attr_count
662CMS_verify 662CMS_verify
663CMS_verify_receipt 663CMS_verify_receipt
664COMP_CTX_free
665COMP_CTX_new
666COMP_compress_block
667COMP_expand_block
668COMP_rle
669COMP_zlib
670COMP_zlib_cleanup
671CONF_dump_bio 664CONF_dump_bio
672CONF_dump_fp 665CONF_dump_fp
673CONF_free 666CONF_free
@@ -1312,7 +1305,6 @@ ERR_load_BIO_strings
1312ERR_load_BN_strings 1305ERR_load_BN_strings
1313ERR_load_BUF_strings 1306ERR_load_BUF_strings
1314ERR_load_CMS_strings 1307ERR_load_CMS_strings
1315ERR_load_COMP_strings
1316ERR_load_CONF_strings 1308ERR_load_CONF_strings
1317ERR_load_CRYPTO_strings 1309ERR_load_CRYPTO_strings
1318ERR_load_DH_strings 1310ERR_load_DH_strings
diff --git a/src/lib/libcrypto/Symbols.namespace b/src/lib/libcrypto/Symbols.namespace
index 9dd16a93f2..57727a186e 100644
--- a/src/lib/libcrypto/Symbols.namespace
+++ b/src/lib/libcrypto/Symbols.namespace
@@ -1864,14 +1864,6 @@ _libre__CONF_add_string
1864_libre__CONF_get_string 1864_libre__CONF_get_string
1865_libre__CONF_new_data 1865_libre__CONF_new_data
1866_libre__CONF_free_data 1866_libre__CONF_free_data
1867_libre_COMP_CTX_new
1868_libre_COMP_CTX_free
1869_libre_COMP_compress_block
1870_libre_COMP_expand_block
1871_libre_COMP_rle
1872_libre_COMP_zlib
1873_libre_COMP_zlib_cleanup
1874_libre_ERR_load_COMP_strings
1875_libre_CMS_ContentInfo_new 1867_libre_CMS_ContentInfo_new
1876_libre_CMS_ContentInfo_free 1868_libre_CMS_ContentInfo_free
1877_libre_d2i_CMS_ContentInfo 1869_libre_d2i_CMS_ContentInfo
diff --git a/src/lib/libcrypto/comp/c_rle.c b/src/lib/libcrypto/comp/c_rle.c
deleted file mode 100644
index 7907dd83cd..0000000000
--- a/src/lib/libcrypto/comp/c_rle.c
+++ /dev/null
@@ -1,172 +0,0 @@
1/* $OpenBSD: c_rle.c,v 1.12 2023/07/08 08:26:26 beck Exp $ */
2/*
3 * ---------------------------------------------------------------------------
4 * Patches to this file were contributed by
5 * Ulf Moeller <ulf@openssl.org> and Bodo Moeller <bodo@openssl.org>.
6 * ---------------------------------------------------------------------------
7 * Copyright (c) 1999, 2011 The OpenSSL Project. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in
18 * the documentation and/or other materials provided with the
19 * distribution.
20 *
21 * 3. All advertising materials mentioning features or use of this
22 * software must display the following acknowledgment:
23 * "This product includes software developed by the OpenSSL Project
24 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
25 *
26 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27 * endorse or promote products derived from this software without
28 * prior written permission. For written permission, please contact
29 * licensing@OpenSSL.org.
30 *
31 * 5. Products derived from this software may not be called "OpenSSL"
32 * nor may "OpenSSL" appear in their names without prior written
33 * permission of the OpenSSL Project.
34 *
35 * 6. Redistributions of any form whatsoever must retain the following
36 * acknowledgment:
37 * "This product includes software developed by the OpenSSL Project
38 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
39 *
40 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51 * OF THE POSSIBILITY OF SUCH DAMAGE.
52 *
53 * ---------------------------------------------------------------------------
54 * Parts of this file are derived from SSLeay code
55 * which is covered by the following Copyright and license:
56 * ---------------------------------------------------------------------------
57 * Copyright (c) 1998 Eric Young <eay@cryptsoft.com>
58 * All rights reserved.
59 *
60 * This package is an SSL implementation written
61 * by Eric Young <eay@cryptsoft.com>.
62 * The implementation was written so as to conform with Netscapes SSL.
63 *
64 * This library is free for commercial and non-commercial use as long as
65 * the following conditions are aheared to. The following conditions
66 * apply to all code found in this distribution, be it the RC4, RSA,
67 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
68 * included with this distribution is covered by the same copyright terms
69 * except that the holder is Tim Hudson <tjh@cryptsoft.com>.
70 *
71 * Copyright remains Eric Young's, and as such any Copyright notices in
72 * the code are not to be removed.
73 * If this package is used in a product, Eric Young should be given
74 * attribution as the author of the parts of the library used.
75 * This can be in the form of a textual message at program startup or
76 * in documentation (online or textual) provided with the package.
77 *
78 * Redistribution and use in source and binary forms, with or without
79 * modification, are permitted provided that the following conditions
80 * are met:
81 * 1. Redistributions of source code must retain the copyright
82 * notice, this list of conditions and the following disclaimer.
83 * 2. Redistributions in binary form must reproduce the above copyright
84 * notice, this list of conditions and the following disclaimer in the
85 * documentation and/or other materials provided with the distribution.
86 * 3. All advertising materials mentioning features or use of this software
87 * must display the following acknowledgement:
88 * "This product includes cryptographic software written by
89 * Eric Young <eay@cryptsoft.com>"
90 * The word 'cryptographic' can be left out if the rouines from the
91 * library being used are not cryptographic related :-).
92 * 4. If you include any Windows specific code (or a derivative thereof)
93 * from the apps directory (application code) you must include an
94 * acknowledgement: "This product includes software written
95 * by Tim Hudson <tjh@cryptsoft.com>"
96 *
97 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
98 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
99 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
100 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
101 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
102 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
103 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
104 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
105 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
106 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
107 * SUCH DAMAGE.
108 *
109 * The licence and distribution terms for any publically available version
110 * or derivative of this code cannot be changed. i.e. this code cannot
111 * simply be copied and put under another distribution licence
112 * [including the GNU Public Licence.]
113 */
114
115#include <stdio.h>
116#include <stdlib.h>
117#include <string.h>
118
119#include <openssl/objects.h>
120#include <openssl/comp.h>
121
122#include "comp_local.h"
123
124static int rle_compress_block(COMP_CTX *ctx, unsigned char *out,
125 unsigned int olen, unsigned char *in, unsigned int ilen);
126static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
127 unsigned int olen, unsigned char *in, unsigned int ilen);
128
129static COMP_METHOD rle_method = {
130 .type = NID_rle_compression,
131 .name = LN_rle_compression,
132 .compress = rle_compress_block,
133 .expand = rle_expand_block
134};
135
136COMP_METHOD *
137COMP_rle(void)
138{
139 return (&rle_method);
140}
141LCRYPTO_ALIAS(COMP_rle);
142
143static int
144rle_compress_block(COMP_CTX *ctx, unsigned char *out, unsigned int olen,
145 unsigned char *in, unsigned int ilen)
146{
147
148 if (ilen == 0 || olen < (ilen - 1)) {
149 return (-1);
150 }
151
152 *(out++) = 0;
153 memcpy(out, in, ilen);
154 return (ilen + 1);
155}
156
157static int
158rle_expand_block(COMP_CTX *ctx, unsigned char *out, unsigned int olen,
159 unsigned char *in, unsigned int ilen)
160{
161 int i;
162
163 if (olen < (ilen - 1)) {
164 return (-1);
165 }
166
167 i= *(in++);
168 if (i == 0) {
169 memcpy(out, in, ilen - 1);
170 }
171 return (ilen - 1);
172}
diff --git a/src/lib/libcrypto/comp/c_zlib.c b/src/lib/libcrypto/comp/c_zlib.c
deleted file mode 100644
index 087e2f4c61..0000000000
--- a/src/lib/libcrypto/comp/c_zlib.c
+++ /dev/null
@@ -1,146 +0,0 @@
1/* $OpenBSD: c_zlib.c,v 1.28 2023/07/08 08:26:26 beck Exp $ */
2/*
3 * ---------------------------------------------------------------------------
4 * Major patches to this file were contributed by
5 * Richard Levitte <levitte@openssl.org>, Nils Larsch <nils@openssl.org>,
6 * and Dr. Stephen Henson <steve@openssl.org>.
7 * ---------------------------------------------------------------------------
8 * Copyright (c) 2002, 2003, 2007, 2008, 2010 The OpenSSL Project.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 *
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 *
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in
20 * the documentation and/or other materials provided with the
21 * distribution.
22 *
23 * 3. All advertising materials mentioning features or use of this
24 * software must display the following acknowledgment:
25 * "This product includes software developed by the OpenSSL Project
26 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
27 *
28 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
29 * endorse or promote products derived from this software without
30 * prior written permission. For written permission, please contact
31 * licensing@OpenSSL.org.
32 *
33 * 5. Products derived from this software may not be called "OpenSSL"
34 * nor may "OpenSSL" appear in their names without prior written
35 * permission of the OpenSSL Project.
36 *
37 * 6. Redistributions of any form whatsoever must retain the following
38 * acknowledgment:
39 * "This product includes software developed by the OpenSSL Project
40 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
41 *
42 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
43 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
45 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
46 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
48 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
49 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
51 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
52 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
53 * OF THE POSSIBILITY OF SUCH DAMAGE.
54 *
55 * ---------------------------------------------------------------------------
56 * Parts of this file are derived from SSLeay code
57 * which is covered by the following Copyright and license:
58 * ---------------------------------------------------------------------------
59 * Copyright (c) 1998 Eric Young <eay@cryptsoft.com>
60 * All rights reserved.
61 *
62 * This package is an SSL implementation written
63 * by Eric Young <eay@cryptsoft.com>.
64 * The implementation was written so as to conform with Netscapes SSL.
65 *
66 * This library is free for commercial and non-commercial use as long as
67 * the following conditions are aheared to. The following conditions
68 * apply to all code found in this distribution, be it the RC4, RSA,
69 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
70 * included with this distribution is covered by the same copyright terms
71 * except that the holder is Tim Hudson <tjh@cryptsoft.com>.
72 *
73 * Copyright remains Eric Young's, and as such any Copyright notices in
74 * the code are not to be removed.
75 * If this package is used in a product, Eric Young should be given
76 * attribution as the author of the parts of the library used.
77 * This can be in the form of a textual message at program startup or
78 * in documentation (online or textual) provided with the package.
79 *
80 * Redistribution and use in source and binary forms, with or without
81 * modification, are permitted provided that the following conditions
82 * are met:
83 * 1. Redistributions of source code must retain the copyright
84 * notice, this list of conditions and the following disclaimer.
85 * 2. Redistributions in binary form must reproduce the above copyright
86 * notice, this list of conditions and the following disclaimer in the
87 * documentation and/or other materials provided with the distribution.
88 * 3. All advertising materials mentioning features or use of this software
89 * must display the following acknowledgement:
90 * "This product includes cryptographic software written by
91 * Eric Young <eay@cryptsoft.com>"
92 * The word 'cryptographic' can be left out if the rouines from the
93 * library being used are not cryptographic related :-).
94 * 4. If you include any Windows specific code (or a derivative thereof)
95 * from the apps directory (application code) you must include an
96 * acknowledgement: "This product includes software written
97 * by Tim Hudson <tjh@cryptsoft.com>"
98 *
99 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
100 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
101 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
102 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
103 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
104 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
105 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
106 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
107 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
108 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
109 * SUCH DAMAGE.
110 *
111 * The licence and distribution terms for any publically available version
112 * or derivative of this code cannot be changed. i.e. this code cannot
113 * simply be copied and put under another distribution licence
114 * [including the GNU Public Licence.]
115 */
116
117#include <stdio.h>
118#include <stdlib.h>
119#include <string.h>
120
121#include <openssl/objects.h>
122#include <openssl/comp.h>
123#include <openssl/err.h>
124
125#include "bio_local.h"
126#include "comp_local.h"
127
128COMP_METHOD *COMP_zlib(void );
129
130static COMP_METHOD zlib_method_nozlib = {
131 .type = NID_undef,
132 .name = "(undef)"
133};
134
135COMP_METHOD *
136COMP_zlib(void)
137{
138 return &zlib_method_nozlib;
139}
140LCRYPTO_ALIAS(COMP_zlib);
141
142void
143COMP_zlib_cleanup(void)
144{
145}
146LCRYPTO_ALIAS(COMP_zlib_cleanup);
diff --git a/src/lib/libcrypto/comp/comp.h b/src/lib/libcrypto/comp/comp.h
index 8f3645f37b..f0330276f0 100644
--- a/src/lib/libcrypto/comp/comp.h
+++ b/src/lib/libcrypto/comp/comp.h
@@ -1,152 +1,7 @@
1/* $OpenBSD: comp.h,v 1.12 2023/06/11 05:35:43 tb Exp $ */ 1/* $OpenBSD: comp.h,v 1.13 2023/07/28 09:42:44 tb Exp $ */
2
2/* 3/*
3 * --------------------------------------------------------------------------- 4 * Public domain.
4 * Patches to this file were contributed by
5 * Dr. Stephen Henson <steve@openssl.org>.
6 * ---------------------------------------------------------------------------
7 * Copyright (c) 1999, 2002, 2008 The OpenSSL Project. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in
18 * the documentation and/or other materials provided with the
19 * distribution.
20 *
21 * 3. All advertising materials mentioning features or use of this
22 * software must display the following acknowledgment:
23 * "This product includes software developed by the OpenSSL Project
24 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
25 *
26 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27 * endorse or promote products derived from this software without
28 * prior written permission. For written permission, please contact
29 * licensing@OpenSSL.org.
30 *
31 * 5. Products derived from this software may not be called "OpenSSL"
32 * nor may "OpenSSL" appear in their names without prior written
33 * permission of the OpenSSL Project.
34 *
35 * 6. Redistributions of any form whatsoever must retain the following
36 * acknowledgment:
37 * "This product includes software developed by the OpenSSL Project
38 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
39 *
40 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51 * OF THE POSSIBILITY OF SUCH DAMAGE.
52 *
53 * ---------------------------------------------------------------------------
54 * Parts of this file are derived from SSLeay code
55 * which is covered by the following Copyright and license:
56 * ---------------------------------------------------------------------------
57 * Copyright (c) 1998 Eric Young <eay@cryptsoft.com>
58 * All rights reserved.
59 *
60 * This package is an SSL implementation written
61 * by Eric Young <eay@cryptsoft.com>.
62 * The implementation was written so as to conform with Netscapes SSL.
63 *
64 * This library is free for commercial and non-commercial use as long as
65 * the following conditions are aheared to. The following conditions
66 * apply to all code found in this distribution, be it the RC4, RSA,
67 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
68 * included with this distribution is covered by the same copyright terms
69 * except that the holder is Tim Hudson <tjh@cryptsoft.com>.
70 * 5 *
71 * Copyright remains Eric Young's, and as such any Copyright notices in 6 * This header is intentionally left empty. Some software uses it unnecessarily.
72 * the code are not to be removed.
73 * If this package is used in a product, Eric Young should be given
74 * attribution as the author of the parts of the library used.
75 * This can be in the form of a textual message at program startup or
76 * in documentation (online or textual) provided with the package.
77 *
78 * Redistribution and use in source and binary forms, with or without
79 * modification, are permitted provided that the following conditions
80 * are met:
81 * 1. Redistributions of source code must retain the copyright
82 * notice, this list of conditions and the following disclaimer.
83 * 2. Redistributions in binary form must reproduce the above copyright
84 * notice, this list of conditions and the following disclaimer in the
85 * documentation and/or other materials provided with the distribution.
86 * 3. All advertising materials mentioning features or use of this software
87 * must display the following acknowledgement:
88 * "This product includes cryptographic software written by
89 * Eric Young <eay@cryptsoft.com>"
90 * The word 'cryptographic' can be left out if the rouines from the
91 * library being used are not cryptographic related :-).
92 * 4. If you include any Windows specific code (or a derivative thereof)
93 * from the apps directory (application code) you must include an
94 * acknowledgement: "This product includes software written
95 * by Tim Hudson <tjh@cryptsoft.com>"
96 *
97 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
98 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
99 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
100 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
101 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
102 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
103 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
104 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
105 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
106 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
107 * SUCH DAMAGE.
108 *
109 * The licence and distribution terms for any publically available version
110 * or derivative of this code cannot be changed. i.e. this code cannot
111 * simply be copied and put under another distribution licence
112 * [including the GNU Public Licence.]
113 */ 7 */
114
115#ifndef HEADER_COMP_H
116#define HEADER_COMP_H
117
118#include <openssl/crypto.h>
119
120#ifdef __cplusplus
121extern "C" {
122#endif
123
124COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
125void COMP_CTX_free(COMP_CTX *ctx);
126int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
127 unsigned char *in, int ilen);
128int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
129 unsigned char *in, int ilen);
130COMP_METHOD *COMP_rle(void );
131COMP_METHOD *COMP_zlib(void );
132void COMP_zlib_cleanup(void);
133
134void ERR_load_COMP_strings(void);
135
136/* Error codes for the COMP functions. */
137
138/* Function codes. */
139#define COMP_F_BIO_ZLIB_FLUSH 99
140#define COMP_F_BIO_ZLIB_NEW 100
141#define COMP_F_BIO_ZLIB_READ 101
142#define COMP_F_BIO_ZLIB_WRITE 102
143
144/* Reason codes. */
145#define COMP_R_ZLIB_DEFLATE_ERROR 99
146#define COMP_R_ZLIB_INFLATE_ERROR 100
147#define COMP_R_ZLIB_NOT_SUPPORTED 101
148
149#ifdef __cplusplus
150}
151#endif
152#endif
diff --git a/src/lib/libcrypto/comp/comp_err.c b/src/lib/libcrypto/comp/comp_err.c
deleted file mode 100644
index 49c476c023..0000000000
--- a/src/lib/libcrypto/comp/comp_err.c
+++ /dev/null
@@ -1,95 +0,0 @@
1/* $OpenBSD: comp_err.c,v 1.14 2023/07/08 08:26:26 beck Exp $ */
2/* ====================================================================
3 * This file was written by Dr. Stephen Henson <steve@openssl.org>.
4 * Copyright (c) 1999, 2005, 2008 The OpenSSL Project. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 *
18 * 3. All advertising materials mentioning features or use of this
19 * software must display the following acknowledgment:
20 * "This product includes software developed by the OpenSSL Project
21 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
22 *
23 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
24 * endorse or promote products derived from this software without
25 * prior written permission. For written permission, please contact
26 * openssl-core@OpenSSL.org.
27 *
28 * 5. Products derived from this software may not be called "OpenSSL"
29 * nor may "OpenSSL" appear in their names without prior written
30 * permission of the OpenSSL Project.
31 *
32 * 6. Redistributions of any form whatsoever must retain the following
33 * acknowledgment:
34 * "This product includes software developed by the OpenSSL Project
35 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
36 *
37 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
38 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
40 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
41 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
43 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
44 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
45 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
46 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
47 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
48 * OF THE POSSIBILITY OF SUCH DAMAGE.
49 * ====================================================================
50 *
51 * This product includes cryptographic software written by Eric Young
52 * (eay@cryptsoft.com). This product includes software written by Tim
53 * Hudson (tjh@cryptsoft.com).
54 *
55 */
56
57#include <stdio.h>
58
59#include <openssl/opensslconf.h>
60
61#include <openssl/comp.h>
62#include <openssl/err.h>
63
64#include "comp_local.h"
65
66#ifndef OPENSSL_NO_ERR
67
68#define ERR_FUNC(func) ERR_PACK(ERR_LIB_COMP,func,0)
69#define ERR_REASON(reason) ERR_PACK(ERR_LIB_COMP,0,reason)
70
71static ERR_STRING_DATA COMP_str_functs[] = {
72 {ERR_FUNC(0xfff), "CRYPTO_internal"},
73 {0, NULL}
74};
75
76static ERR_STRING_DATA COMP_str_reasons[] = {
77 {ERR_REASON(COMP_R_ZLIB_DEFLATE_ERROR) , "zlib deflate error"},
78 {ERR_REASON(COMP_R_ZLIB_INFLATE_ERROR) , "zlib inflate error"},
79 {ERR_REASON(COMP_R_ZLIB_NOT_SUPPORTED) , "zlib not supported"},
80 {0, NULL}
81};
82
83#endif
84
85void
86ERR_load_COMP_strings(void)
87{
88#ifndef OPENSSL_NO_ERR
89 if (ERR_func_error_string(COMP_str_functs[0].error) == NULL) {
90 ERR_load_strings(0, COMP_str_functs);
91 ERR_load_strings(0, COMP_str_reasons);
92 }
93#endif
94}
95LCRYPTO_ALIAS(ERR_load_COMP_strings);
diff --git a/src/lib/libcrypto/comp/comp_lib.c b/src/lib/libcrypto/comp/comp_lib.c
deleted file mode 100644
index f26edc0002..0000000000
--- a/src/lib/libcrypto/comp/comp_lib.c
+++ /dev/null
@@ -1,188 +0,0 @@
1/* $OpenBSD: comp_lib.c,v 1.12 2023/07/08 08:26:26 beck Exp $ */
2/*
3 * ---------------------------------------------------------------------------
4 * Patches to this file were contributed by
5 * Ben Laurie <ben@openssl.org> and Ulf Moeller <ulf@openssl.org>.
6 * ---------------------------------------------------------------------------
7 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in
18 * the documentation and/or other materials provided with the
19 * distribution.
20 *
21 * 3. All advertising materials mentioning features or use of this
22 * software must display the following acknowledgment:
23 * "This product includes software developed by the OpenSSL Project
24 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
25 *
26 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27 * endorse or promote products derived from this software without
28 * prior written permission. For written permission, please contact
29 * licensing@OpenSSL.org.
30 *
31 * 5. Products derived from this software may not be called "OpenSSL"
32 * nor may "OpenSSL" appear in their names without prior written
33 * permission of the OpenSSL Project.
34 *
35 * 6. Redistributions of any form whatsoever must retain the following
36 * acknowledgment:
37 * "This product includes software developed by the OpenSSL Project
38 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
39 *
40 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51 * OF THE POSSIBILITY OF SUCH DAMAGE.
52 *
53 * ---------------------------------------------------------------------------
54 * Parts of this file are derived from SSLeay code
55 * which is covered by the following Copyright and license:
56 * ---------------------------------------------------------------------------
57 * Copyright (c) 1998 Eric Young <eay@cryptsoft.com>
58 * All rights reserved.
59 *
60 * This package is an SSL implementation written
61 * by Eric Young <eay@cryptsoft.com>.
62 * The implementation was written so as to conform with Netscapes SSL.
63 *
64 * This library is free for commercial and non-commercial use as long as
65 * the following conditions are aheared to. The following conditions
66 * apply to all code found in this distribution, be it the RC4, RSA,
67 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
68 * included with this distribution is covered by the same copyright terms
69 * except that the holder is Tim Hudson <tjh@cryptsoft.com>.
70 *
71 * Copyright remains Eric Young's, and as such any Copyright notices in
72 * the code are not to be removed.
73 * If this package is used in a product, Eric Young should be given
74 * attribution as the author of the parts of the library used.
75 * This can be in the form of a textual message at program startup or
76 * in documentation (online or textual) provided with the package.
77 *
78 * Redistribution and use in source and binary forms, with or without
79 * modification, are permitted provided that the following conditions
80 * are met:
81 * 1. Redistributions of source code must retain the copyright
82 * notice, this list of conditions and the following disclaimer.
83 * 2. Redistributions in binary form must reproduce the above copyright
84 * notice, this list of conditions and the following disclaimer in the
85 * documentation and/or other materials provided with the distribution.
86 * 3. All advertising materials mentioning features or use of this software
87 * must display the following acknowledgement:
88 * "This product includes cryptographic software written by
89 * Eric Young <eay@cryptsoft.com>"
90 * The word 'cryptographic' can be left out if the rouines from the
91 * library being used are not cryptographic related :-).
92 * 4. If you include any Windows specific code (or a derivative thereof)
93 * from the apps directory (application code) you must include an
94 * acknowledgement: "This product includes software written
95 * by Tim Hudson <tjh@cryptsoft.com>"
96 *
97 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
98 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
99 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
100 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
101 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
102 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
103 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
104 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
105 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
106 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
107 * SUCH DAMAGE.
108 *
109 * The licence and distribution terms for any publically available version
110 * or derivative of this code cannot be changed. i.e. this code cannot
111 * simply be copied and put under another distribution licence
112 * [including the GNU Public Licence.]
113 */
114
115#include <stdio.h>
116#include <stdlib.h>
117#include <string.h>
118
119#include <openssl/objects.h>
120#include <openssl/comp.h>
121
122#include "comp_local.h"
123
124COMP_CTX *
125COMP_CTX_new(COMP_METHOD *meth)
126{
127 COMP_CTX *ret;
128
129 if ((ret = calloc(1, sizeof(COMP_CTX))) == NULL) {
130 return (NULL);
131 }
132 ret->meth = meth;
133 if ((ret->meth->init != NULL) && !ret->meth->init(ret)) {
134 free(ret);
135 ret = NULL;
136 }
137 return (ret);
138}
139LCRYPTO_ALIAS(COMP_CTX_new);
140
141void
142COMP_CTX_free(COMP_CTX *ctx)
143{
144 if (ctx == NULL)
145 return;
146
147 if (ctx->meth->finish != NULL)
148 ctx->meth->finish(ctx);
149
150 free(ctx);
151}
152LCRYPTO_ALIAS(COMP_CTX_free);
153
154int
155COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
156 unsigned char *in, int ilen)
157{
158 int ret;
159
160 if (ctx->meth->compress == NULL) {
161 return (-1);
162 }
163 ret = ctx->meth->compress(ctx, out, olen, in, ilen);
164 if (ret > 0) {
165 ctx->compress_in += ilen;
166 ctx->compress_out += ret;
167 }
168 return (ret);
169}
170LCRYPTO_ALIAS(COMP_compress_block);
171
172int
173COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
174 unsigned char *in, int ilen)
175{
176 int ret;
177
178 if (ctx->meth->expand == NULL) {
179 return (-1);
180 }
181 ret = ctx->meth->expand(ctx, out, olen, in, ilen);
182 if (ret > 0) {
183 ctx->expand_in += ilen;
184 ctx->expand_out += ret;
185 }
186 return (ret);
187}
188LCRYPTO_ALIAS(COMP_expand_block);
diff --git a/src/lib/libcrypto/comp/comp_local.h b/src/lib/libcrypto/comp/comp_local.h
deleted file mode 100644
index e26a800ba3..0000000000
--- a/src/lib/libcrypto/comp/comp_local.h
+++ /dev/null
@@ -1,148 +0,0 @@
1/* $OpenBSD: comp_local.h,v 1.4 2022/12/24 07:12:09 tb Exp $ */
2/*
3 * ---------------------------------------------------------------------------
4 * Patches to this file were contributed by
5 * Richard Levitte <levitte@openssl.org>.
6 * ---------------------------------------------------------------------------
7 * Copyright (c) 1999, 2000, 2003 The OpenSSL Project. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in
18 * the documentation and/or other materials provided with the
19 * distribution.
20 *
21 * 3. All advertising materials mentioning features or use of this
22 * software must display the following acknowledgment:
23 * "This product includes software developed by the OpenSSL Project
24 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
25 *
26 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27 * endorse or promote products derived from this software without
28 * prior written permission. For written permission, please contact
29 * licensing@OpenSSL.org.
30 *
31 * 5. Products derived from this software may not be called "OpenSSL"
32 * nor may "OpenSSL" appear in their names without prior written
33 * permission of the OpenSSL Project.
34 *
35 * 6. Redistributions of any form whatsoever must retain the following
36 * acknowledgment:
37 * "This product includes software developed by the OpenSSL Project
38 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
39 *
40 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51 * OF THE POSSIBILITY OF SUCH DAMAGE.
52 *
53 * ---------------------------------------------------------------------------
54 * Parts of this file are derived from SSLeay code
55 * which is covered by the following Copyright and license:
56 * ---------------------------------------------------------------------------
57 * Copyright (c) 1998 Eric Young <eay@cryptsoft.com>
58 * All rights reserved.
59 *
60 * This package is an SSL implementation written
61 * by Eric Young <eay@cryptsoft.com>.
62 * The implementation was written so as to conform with Netscapes SSL.
63 *
64 * This library is free for commercial and non-commercial use as long as
65 * the following conditions are aheared to. The following conditions
66 * apply to all code found in this distribution, be it the RC4, RSA,
67 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
68 * included with this distribution is covered by the same copyright terms
69 * except that the holder is Tim Hudson <tjh@cryptsoft.com>.
70 *
71 * Copyright remains Eric Young's, and as such any Copyright notices in
72 * the code are not to be removed.
73 * If this package is used in a product, Eric Young should be given
74 * attribution as the author of the parts of the library used.
75 * This can be in the form of a textual message at program startup or
76 * in documentation (online or textual) provided with the package.
77 *
78 * Redistribution and use in source and binary forms, with or without
79 * modification, are permitted provided that the following conditions
80 * are met:
81 * 1. Redistributions of source code must retain the copyright
82 * notice, this list of conditions and the following disclaimer.
83 * 2. Redistributions in binary form must reproduce the above copyright
84 * notice, this list of conditions and the following disclaimer in the
85 * documentation and/or other materials provided with the distribution.
86 * 3. All advertising materials mentioning features or use of this software
87 * must display the following acknowledgement:
88 * "This product includes cryptographic software written by
89 * Eric Young <eay@cryptsoft.com>"
90 * The word 'cryptographic' can be left out if the rouines from the
91 * library being used are not cryptographic related :-).
92 * 4. If you include any Windows specific code (or a derivative thereof)
93 * from the apps directory (application code) you must include an
94 * acknowledgement: "This product includes software written
95 * by Tim Hudson <tjh@cryptsoft.com>"
96 *
97 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
98 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
99 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
100 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
101 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
102 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
103 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
104 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
105 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
106 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
107 * SUCH DAMAGE.
108 *
109 * The licence and distribution terms for any publically available version
110 * or derivative of this code cannot be changed. i.e. this code cannot
111 * simply be copied and put under another distribution licence
112 * [including the GNU Public Licence.]
113 */
114
115#ifndef HEADER_COMP_LOCAL_H
116#define HEADER_COMP_LOCAL_H
117
118__BEGIN_HIDDEN_DECLS
119
120struct CMP_CTX;
121
122struct comp_method_st {
123 int type; /* NID for compression library */
124 const char *name; /* A text string to identify the library */
125 int (*init)(COMP_CTX *ctx);
126 void (*finish)(COMP_CTX *ctx);
127 int (*compress)(COMP_CTX *ctx, unsigned char *out, unsigned int olen,
128 unsigned char *in, unsigned int ilen);
129 int (*expand)(COMP_CTX *ctx, unsigned char *out, unsigned int olen,
130 unsigned char *in, unsigned int ilen);
131 /* The following two do NOTHING, but are kept for backward compatibility */
132 long (*ctrl)(void);
133 long (*callback_ctrl)(void);
134} /* COMP_METHOD */;
135
136struct comp_ctx_st {
137 COMP_METHOD *meth;
138 unsigned long compress_in;
139 unsigned long compress_out;
140 unsigned long expand_in;
141 unsigned long expand_out;
142
143 CRYPTO_EX_DATA ex_data;
144} /* COMP_CTX */;
145
146__END_HIDDEN_DECLS
147
148#endif /* !HEADER_COMP_LOCAL_H */
diff --git a/src/lib/libcrypto/hidden/openssl/comp.h b/src/lib/libcrypto/hidden/openssl/comp.h
deleted file mode 100644
index fc97324eac..0000000000
--- a/src/lib/libcrypto/hidden/openssl/comp.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/* $OpenBSD: comp.h,v 1.1 2023/07/08 08:26:26 beck Exp $ */
2/*
3 * Copyright (c) 2023 Bob Beck <beck@openbsd.org>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#ifndef _LIBCRYPTO_COMP_H
19#define _LIBCRYPTO_COMP_H
20
21#ifndef _MSC_VER
22#include_next <openssl/comp.h>
23#else
24#include "../include/openssl/comp.h"
25#endif
26#include "crypto_namespace.h"
27
28LCRYPTO_USED(COMP_CTX_new);
29LCRYPTO_USED(COMP_CTX_free);
30LCRYPTO_USED(COMP_compress_block);
31LCRYPTO_USED(COMP_expand_block);
32LCRYPTO_USED(COMP_rle);
33LCRYPTO_USED(COMP_zlib);
34LCRYPTO_USED(COMP_zlib_cleanup);
35LCRYPTO_USED(ERR_load_COMP_strings);
36
37#endif /* _LIBCRYPTO_COMP_H */