diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/ameth_lib.c')
-rw-r--r-- | src/lib/libcrypto/asn1/ameth_lib.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/lib/libcrypto/asn1/ameth_lib.c b/src/lib/libcrypto/asn1/ameth_lib.c index 168321618c..b27d72af45 100644 --- a/src/lib/libcrypto/asn1/ameth_lib.c +++ b/src/lib/libcrypto/asn1/ameth_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ameth_lib.c,v 1.15 2014/11/09 19:17:13 miod Exp $ */ | 1 | /* $OpenBSD: ameth_lib.c,v 1.16 2017/01/21 04:31:25 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -114,8 +114,9 @@ typedef int sk_cmp_fn_type(const char * const *a, const char * const *b); | |||
114 | DECLARE_STACK_OF(EVP_PKEY_ASN1_METHOD) | 114 | DECLARE_STACK_OF(EVP_PKEY_ASN1_METHOD) |
115 | static STACK_OF(EVP_PKEY_ASN1_METHOD) *app_methods = NULL; | 115 | static STACK_OF(EVP_PKEY_ASN1_METHOD) *app_methods = NULL; |
116 | 116 | ||
117 | DECLARE_OBJ_BSEARCH_CMP_FN(const EVP_PKEY_ASN1_METHOD *, | 117 | static int ameth_cmp_BSEARCH_CMP_FN(const void *, const void *); |
118 | const EVP_PKEY_ASN1_METHOD *, ameth); | 118 | static int ameth_cmp(const EVP_PKEY_ASN1_METHOD * const *, const EVP_PKEY_ASN1_METHOD * const *); |
119 | static const EVP_PKEY_ASN1_METHOD * *OBJ_bsearch_ameth(const EVP_PKEY_ASN1_METHOD * *key, const EVP_PKEY_ASN1_METHOD * const *base, int num); | ||
119 | 120 | ||
120 | static int | 121 | static int |
121 | ameth_cmp(const EVP_PKEY_ASN1_METHOD * const *a, | 122 | ameth_cmp(const EVP_PKEY_ASN1_METHOD * const *a, |
@@ -124,8 +125,21 @@ ameth_cmp(const EVP_PKEY_ASN1_METHOD * const *a, | |||
124 | return ((*a)->pkey_id - (*b)->pkey_id); | 125 | return ((*a)->pkey_id - (*b)->pkey_id); |
125 | } | 126 | } |
126 | 127 | ||
127 | IMPLEMENT_OBJ_BSEARCH_CMP_FN(const EVP_PKEY_ASN1_METHOD *, | 128 | |
128 | const EVP_PKEY_ASN1_METHOD *, ameth); | 129 | static int |
130 | ameth_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) | ||
131 | { | ||
132 | const EVP_PKEY_ASN1_METHOD * const *a = a_; | ||
133 | const EVP_PKEY_ASN1_METHOD * const *b = b_; | ||
134 | return ameth_cmp(a, b); | ||
135 | } | ||
136 | |||
137 | static const EVP_PKEY_ASN1_METHOD * * | ||
138 | OBJ_bsearch_ameth(const EVP_PKEY_ASN1_METHOD * *key, const EVP_PKEY_ASN1_METHOD * const *base, int num) | ||
139 | { | ||
140 | return (const EVP_PKEY_ASN1_METHOD * *)OBJ_bsearch_(key, base, num, sizeof(const EVP_PKEY_ASN1_METHOD *), | ||
141 | ameth_cmp_BSEARCH_CMP_FN); | ||
142 | } | ||
129 | 143 | ||
130 | int | 144 | int |
131 | EVP_PKEY_asn1_get_count(void) | 145 | EVP_PKEY_asn1_get_count(void) |