diff options
author | tb <> | 2024-03-02 11:11:11 +0000 |
---|---|---|
committer | tb <> | 2024-03-02 11:11:11 +0000 |
commit | 3228d4664f5cbc8a4b11e8d1cf7aa6636946f529 (patch) | |
tree | 865633fee7fa46f45fa7bee8495692a2bf76544f /src/lib/libcrypto/stack/stack.h | |
parent | 2e45bf0bb5ba5d679b984ec185fbc3d2a6270f6f (diff) | |
download | openbsd-3228d4664f5cbc8a4b11e8d1cf7aa6636946f529.tar.gz openbsd-3228d4664f5cbc8a4b11e8d1cf7aa6636946f529.tar.bz2 openbsd-3228d4664f5cbc8a4b11e8d1cf7aa6636946f529.zip |
Make LHASH_OF() and STACK_OF() use opaque structs
This removes internals of these two special snowflakes and will allow
further simplifications. Unfortunately, there are some pieces of
software that actually use LHASH_OF() (looking at you, pound, Ruby, and
openssl(1)), so we get to keep exposing this garbage, at least for now.
Expose lh_error() as a symbol to replace a macro reaching into _LHASH.
lh_down_load() is no longer available. _LHASH and _STACK are now opaque,
LHASH_NODE becomes internal-only.
from jsing
Diffstat (limited to 'src/lib/libcrypto/stack/stack.h')
-rw-r--r-- | src/lib/libcrypto/stack/stack.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/lib/libcrypto/stack/stack.h b/src/lib/libcrypto/stack/stack.h index 6bea6348f2..8b490c7225 100644 --- a/src/lib/libcrypto/stack/stack.h +++ b/src/lib/libcrypto/stack/stack.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: stack.h,v 1.9 2014/06/12 15:49:30 deraadt Exp $ */ | 1 | /* $OpenBSD: stack.h,v 1.10 2024/03/02 11:11:11 tb 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 | * |
@@ -63,14 +63,7 @@ | |||
63 | extern "C" { | 63 | extern "C" { |
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | typedef struct stack_st { | 66 | typedef struct stack_st _STACK; |
67 | int num; | ||
68 | char **data; | ||
69 | int sorted; | ||
70 | |||
71 | int num_alloc; | ||
72 | int (*comp)(const void *, const void *); | ||
73 | } _STACK; /* Use STACK_OF(...) instead */ | ||
74 | 67 | ||
75 | #define M_sk_num(sk) ((sk) ? (sk)->num:-1) | 68 | #define M_sk_num(sk) ((sk) ? (sk)->num:-1) |
76 | #define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) | 69 | #define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) |