diff options
author | jsing <> | 2024-07-14 14:32:45 +0000 |
---|---|---|
committer | jsing <> | 2024-07-14 14:32:45 +0000 |
commit | 3006ff83f98c4783ee71689e5e63047b95dc7bca (patch) | |
tree | be3db2d41eeefc4911bb452b4bdad674ec31828b | |
parent | 1321c907704edb09732b01534fbb20795096f774 (diff) | |
download | openbsd-3006ff83f98c4783ee71689e5e63047b95dc7bca.tar.gz openbsd-3006ff83f98c4783ee71689e5e63047b95dc7bca.tar.bz2 openbsd-3006ff83f98c4783ee71689e5e63047b95dc7bca.zip |
Remove lhash_local.h.
lhash_local.h was previously needed since conf/conf_api.c and
objects/obj_dat.c were fiddling with lhash internals when deleting via a
callback. Since we no longer need to do that, inline the structs in
lhash.c and remove the header.
ok tb@
-rw-r--r-- | src/lib/libcrypto/conf/conf_api.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/lhash/lhash.c | 27 | ||||
-rw-r--r-- | src/lib/libcrypto/lhash/lhash_local.h | 91 | ||||
-rw-r--r-- | src/lib/libcrypto/objects/obj_dat.c | 3 |
4 files changed, 26 insertions, 99 deletions
diff --git a/src/lib/libcrypto/conf/conf_api.c b/src/lib/libcrypto/conf/conf_api.c index b78bd50c2c..a94e8c8be0 100644 --- a/src/lib/libcrypto/conf/conf_api.c +++ b/src/lib/libcrypto/conf/conf_api.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: conf_api.c,v 1.18 2024/03/02 11:11:11 tb Exp $ */ | 1 | /* $OpenBSD: conf_api.c,v 1.19 2024/07/14 14:32:45 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -69,8 +69,6 @@ | |||
69 | #include <openssl/conf.h> | 69 | #include <openssl/conf.h> |
70 | #include <openssl/conf_api.h> | 70 | #include <openssl/conf_api.h> |
71 | 71 | ||
72 | #include "lhash_local.h" | ||
73 | |||
74 | static void value_free_hash_doall_arg(CONF_VALUE *a, | 72 | static void value_free_hash_doall_arg(CONF_VALUE *a, |
75 | LHASH_OF(CONF_VALUE) *conf); | 73 | LHASH_OF(CONF_VALUE) *conf); |
76 | static void value_free_stack_doall(CONF_VALUE *a); | 74 | static void value_free_stack_doall(CONF_VALUE *a); |
diff --git a/src/lib/libcrypto/lhash/lhash.c b/src/lib/libcrypto/lhash/lhash.c index 150831c116..aa532267de 100644 --- a/src/lib/libcrypto/lhash/lhash.c +++ b/src/lib/libcrypto/lhash/lhash.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: lhash.c,v 1.27 2024/06/30 14:13:08 jsing Exp $ */ | 1 | /* $OpenBSD: lhash.c,v 1.28 2024/07/14 14:32:45 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -65,13 +65,34 @@ | |||
65 | #include <openssl/crypto.h> | 65 | #include <openssl/crypto.h> |
66 | #include <openssl/lhash.h> | 66 | #include <openssl/lhash.h> |
67 | 67 | ||
68 | #include "lhash_local.h" | ||
69 | |||
70 | #undef MIN_NODES | 68 | #undef MIN_NODES |
71 | #define MIN_NODES 16 | 69 | #define MIN_NODES 16 |
72 | #define UP_LOAD (2*LH_LOAD_MULT) /* load times 256 (default 2) */ | 70 | #define UP_LOAD (2*LH_LOAD_MULT) /* load times 256 (default 2) */ |
73 | #define DOWN_LOAD (LH_LOAD_MULT) /* load times 256 (default 1) */ | 71 | #define DOWN_LOAD (LH_LOAD_MULT) /* load times 256 (default 1) */ |
74 | 72 | ||
73 | typedef struct lhash_node_st { | ||
74 | void *data; | ||
75 | struct lhash_node_st *next; | ||
76 | #ifndef OPENSSL_NO_HASH_COMP | ||
77 | unsigned long hash; | ||
78 | #endif | ||
79 | } LHASH_NODE; | ||
80 | |||
81 | struct lhash_st { | ||
82 | LHASH_NODE **b; | ||
83 | LHASH_COMP_FN_TYPE comp; | ||
84 | LHASH_HASH_FN_TYPE hash; | ||
85 | unsigned int num_nodes; | ||
86 | unsigned int num_alloc_nodes; | ||
87 | unsigned int p; | ||
88 | unsigned int pmax; | ||
89 | unsigned long up_load; /* load times 256 */ | ||
90 | unsigned long down_load; /* load times 256 */ | ||
91 | unsigned long num_items; | ||
92 | |||
93 | int error; | ||
94 | } /* _LHASH */; | ||
95 | |||
75 | static void | 96 | static void |
76 | expand(_LHASH *lh) | 97 | expand(_LHASH *lh) |
77 | { | 98 | { |
diff --git a/src/lib/libcrypto/lhash/lhash_local.h b/src/lib/libcrypto/lhash/lhash_local.h deleted file mode 100644 index 1748845c41..0000000000 --- a/src/lib/libcrypto/lhash/lhash_local.h +++ /dev/null | |||
@@ -1,91 +0,0 @@ | |||
1 | /* $OpenBSD: lhash_local.h,v 1.2 2024/06/30 14:13:08 jsing Exp $ */ | ||
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
18 | * If this package is used in a product, Eric Young should be given attribution | ||
19 | * as the author of the parts of the library used. | ||
20 | * This can be in the form of a textual message at program startup or | ||
21 | * in documentation (online or textual) provided with the package. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | ||
24 | * modification, are permitted provided that the following conditions | ||
25 | * are met: | ||
26 | * 1. Redistributions of source code must retain the copyright | ||
27 | * notice, this list of conditions and the following disclaimer. | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer in the | ||
30 | * documentation and/or other materials provided with the distribution. | ||
31 | * 3. All advertising materials mentioning features or use of this software | ||
32 | * must display the following acknowledgement: | ||
33 | * "This product includes cryptographic software written by | ||
34 | * Eric Young (eay@cryptsoft.com)" | ||
35 | * The word 'cryptographic' can be left out if the rouines from the library | ||
36 | * being used are not cryptographic related :-). | ||
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | ||
38 | * the apps directory (application code) you must include an acknowledgement: | ||
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
40 | * | ||
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
51 | * SUCH DAMAGE. | ||
52 | * | ||
53 | * The licence and distribution terms for any publically available version or | ||
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | ||
55 | * copied and put under another distribution licence | ||
56 | * [including the GNU Public Licence.] | ||
57 | */ | ||
58 | |||
59 | /* Header for dynamic hash table routines | ||
60 | * Author - Eric Young | ||
61 | */ | ||
62 | |||
63 | #include <openssl/opensslconf.h> | ||
64 | |||
65 | #ifndef HEADER_LHASH_LOCAL_H | ||
66 | #define HEADER_LHASH_LOCAL_H | ||
67 | |||
68 | typedef struct lhash_node_st { | ||
69 | void *data; | ||
70 | struct lhash_node_st *next; | ||
71 | #ifndef OPENSSL_NO_HASH_COMP | ||
72 | unsigned long hash; | ||
73 | #endif | ||
74 | } LHASH_NODE; | ||
75 | |||
76 | struct lhash_st { | ||
77 | LHASH_NODE **b; | ||
78 | LHASH_COMP_FN_TYPE comp; | ||
79 | LHASH_HASH_FN_TYPE hash; | ||
80 | unsigned int num_nodes; | ||
81 | unsigned int num_alloc_nodes; | ||
82 | unsigned int p; | ||
83 | unsigned int pmax; | ||
84 | unsigned long up_load; /* load times 256 */ | ||
85 | unsigned long down_load; /* load times 256 */ | ||
86 | unsigned long num_items; | ||
87 | |||
88 | int error; | ||
89 | } /* _LHASH */; | ||
90 | |||
91 | #endif | ||
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c index 1ac854449c..53ae83784f 100644 --- a/src/lib/libcrypto/objects/obj_dat.c +++ b/src/lib/libcrypto/objects/obj_dat.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: obj_dat.c,v 1.90 2024/05/08 16:35:05 tb Exp $ */ | 1 | /* $OpenBSD: obj_dat.c,v 1.91 2024/07/14 14:32:45 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -71,7 +71,6 @@ | |||
71 | #include <openssl/objects.h> | 71 | #include <openssl/objects.h> |
72 | 72 | ||
73 | #include "asn1_local.h" | 73 | #include "asn1_local.h" |
74 | #include "lhash_local.h" | ||
75 | 74 | ||
76 | /* obj_dat.h is generated from objects.h by obj_dat.pl */ | 75 | /* obj_dat.h is generated from objects.h by obj_dat.pl */ |
77 | #include "obj_dat.h" | 76 | #include "obj_dat.h" |