diff options
author | tb <> | 2022-01-14 08:21:12 +0000 |
---|---|---|
committer | tb <> | 2022-01-14 08:21:12 +0000 |
commit | e14062c57c831c060e72723219808d64a4df30da (patch) | |
tree | d35ba256e6406a4df9d8d22f3053ae363531bf9f /src | |
parent | 5c9a6a0190a65419ec242e2449f81335e105a053 (diff) | |
download | openbsd-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.h | 29 | ||||
-rw-r--r-- | src/lib/libcrypto/comp/comp_local.h | 28 | ||||
-rw-r--r-- | src/lib/libcrypto/ossl_typ.h | 5 |
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 @@ | |||
9 | extern "C" { | 9 | extern "C" { |
10 | #endif | 10 | #endif |
11 | 11 | ||
12 | typedef struct comp_ctx_st COMP_CTX; | ||
13 | |||
14 | typedef 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 | |||
28 | struct 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 | |||
39 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); | 12 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); |
40 | void COMP_CTX_free(COMP_CTX *ctx); | 13 | void COMP_CTX_free(COMP_CTX *ctx); |
41 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, | 14 | int 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 | ||
8 | struct CMP_CTX; | ||
9 | |||
10 | struct 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 | |||
24 | struct 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; | |||
95 | typedef struct bio_st BIO; | 95 | typedef struct bio_st BIO; |
96 | typedef struct buf_mem_st BUF_MEM; | 96 | typedef struct buf_mem_st BUF_MEM; |
97 | 97 | ||
98 | typedef struct comp_ctx_st COMP_CTX; | ||
99 | typedef struct comp_method_st COMP_METHOD; | ||
100 | |||
98 | typedef struct evp_cipher_st EVP_CIPHER; | 101 | typedef struct evp_cipher_st EVP_CIPHER; |
99 | typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; | 102 | typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; |
100 | typedef struct env_md_st EVP_MD; | 103 | typedef struct env_md_st EVP_MD; |