summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-01-14 08:21:12 +0000
committertb <>2022-01-14 08:21:12 +0000
commite14062c57c831c060e72723219808d64a4df30da (patch)
treed35ba256e6406a4df9d8d22f3053ae363531bf9f /src
parent5c9a6a0190a65419ec242e2449f81335e105a053 (diff)
downloadopenbsd-e14062c57c831c060e72723219808d64a4df30da.tar.gz
openbsd-e14062c57c831c060e72723219808d64a4df30da.tar.bz2
openbsd-e14062c57c831c060e72723219808d64a4df30da.zip
Make structs in comp.h opaque
This moves COMP_CTX and COMP_METHOD to comp_local.h and provides missing typedefs in ossl_typ.h. ok inoguchi jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/comp/comp.h29
-rw-r--r--src/lib/libcrypto/comp/comp_local.h28
-rw-r--r--src/lib/libcrypto/ossl_typ.h5
3 files changed, 32 insertions, 30 deletions
diff --git a/src/lib/libcrypto/comp/comp.h b/src/lib/libcrypto/comp/comp.h
index fe7397f8ea..7c99ead358 100644
--- a/src/lib/libcrypto/comp/comp.h
+++ b/src/lib/libcrypto/comp/comp.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: comp.h,v 1.8 2014/11/03 16:58:28 tedu Exp $ */ 1/* $OpenBSD: comp.h,v 1.9 2022/01/14 08:21:12 tb Exp $ */
2 2
3#ifndef HEADER_COMP_H 3#ifndef HEADER_COMP_H
4#define HEADER_COMP_H 4#define HEADER_COMP_H
@@ -9,33 +9,6 @@
9extern "C" { 9extern "C" {
10#endif 10#endif
11 11
12typedef struct comp_ctx_st COMP_CTX;
13
14typedef struct comp_method_st {
15 int type; /* NID for compression library */
16 const char *name; /* A text string to identify the library */
17 int (*init)(COMP_CTX *ctx);
18 void (*finish)(COMP_CTX *ctx);
19 int (*compress)(COMP_CTX *ctx, unsigned char *out, unsigned int olen,
20 unsigned char *in, unsigned int ilen);
21 int (*expand)(COMP_CTX *ctx, unsigned char *out, unsigned int olen,
22 unsigned char *in, unsigned int ilen);
23 /* The following two do NOTHING, but are kept for backward compatibility */
24 long (*ctrl)(void);
25 long (*callback_ctrl)(void);
26} COMP_METHOD;
27
28struct comp_ctx_st {
29 COMP_METHOD *meth;
30 unsigned long compress_in;
31 unsigned long compress_out;
32 unsigned long expand_in;
33 unsigned long expand_out;
34
35 CRYPTO_EX_DATA ex_data;
36};
37
38
39COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 12COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
40void COMP_CTX_free(COMP_CTX *ctx); 13void COMP_CTX_free(COMP_CTX *ctx);
41int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 14int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
diff --git a/src/lib/libcrypto/comp/comp_local.h b/src/lib/libcrypto/comp/comp_local.h
index e1dfff1251..fc1888711b 100644
--- a/src/lib/libcrypto/comp/comp_local.h
+++ b/src/lib/libcrypto/comp/comp_local.h
@@ -1,10 +1,36 @@
1/* $OpenBSD: comp_local.h,v 1.1 2022/01/09 23:50:10 tb Exp $ */ 1/* $OpenBSD: comp_local.h,v 1.2 2022/01/14 08:21:12 tb Exp $ */
2 2
3#ifndef HEADER_COMP_LOCAL_H 3#ifndef HEADER_COMP_LOCAL_H
4#define HEADER_COMP_LOCAL_H 4#define HEADER_COMP_LOCAL_H
5 5
6__BEGIN_HIDDEN_DECLS 6__BEGIN_HIDDEN_DECLS
7 7
8struct CMP_CTX;
9
10struct comp_method_st {
11 int type; /* NID for compression library */
12 const char *name; /* A text string to identify the library */
13 int (*init)(COMP_CTX *ctx);
14 void (*finish)(COMP_CTX *ctx);
15 int (*compress)(COMP_CTX *ctx, unsigned char *out, unsigned int olen,
16 unsigned char *in, unsigned int ilen);
17 int (*expand)(COMP_CTX *ctx, unsigned char *out, unsigned int olen,
18 unsigned char *in, unsigned int ilen);
19 /* The following two do NOTHING, but are kept for backward compatibility */
20 long (*ctrl)(void);
21 long (*callback_ctrl)(void);
22} /* COMP_METHOD */;
23
24struct comp_ctx_st {
25 COMP_METHOD *meth;
26 unsigned long compress_in;
27 unsigned long compress_out;
28 unsigned long expand_in;
29 unsigned long expand_out;
30
31 CRYPTO_EX_DATA ex_data;
32} /* COMP_CTX */;
33
8__END_HIDDEN_DECLS 34__END_HIDDEN_DECLS
9 35
10#endif /* !HEADER_COMP_LOCAL_H */ 36#endif /* !HEADER_COMP_LOCAL_H */
diff --git a/src/lib/libcrypto/ossl_typ.h b/src/lib/libcrypto/ossl_typ.h
index 21197f873a..161bf86a3e 100644
--- a/src/lib/libcrypto/ossl_typ.h
+++ b/src/lib/libcrypto/ossl_typ.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ossl_typ.h,v 1.18 2022/01/14 08:18:55 tb Exp $ */ 1/* $OpenBSD: ossl_typ.h,v 1.19 2022/01/14 08:21:12 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -95,6 +95,9 @@ typedef struct bn_gencb_st BN_GENCB;
95typedef struct bio_st BIO; 95typedef struct bio_st BIO;
96typedef struct buf_mem_st BUF_MEM; 96typedef struct buf_mem_st BUF_MEM;
97 97
98typedef struct comp_ctx_st COMP_CTX;
99typedef struct comp_method_st COMP_METHOD;
100
98typedef struct evp_cipher_st EVP_CIPHER; 101typedef struct evp_cipher_st EVP_CIPHER;
99typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; 102typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
100typedef struct env_md_st EVP_MD; 103typedef struct env_md_st EVP_MD;