summaryrefslogtreecommitdiffstats
path: root/crypto/x509v3/v3_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2008-10-22 15:43:01 +0000
committerDr. Stephen Henson <steve@openssl.org>2008-10-22 15:43:01 +0000
commite19106f5fb7da7db15449a9a50f9be9047800757 (patch)
tree0341d860168821112fb47ded07b1f761895c04cd /crypto/x509v3/v3_lib.c
parentae7ec4c71de74fa52c5d89e32e28445c6602990d (diff)
Create function of the form OBJ_bsearch_xxx() in bsearch typesafe macros
with the appropriate parameters which calls OBJ_bsearch(). A compiler will typically inline this. This avoids the need for cmp_xxx variables and fixes unchecked const issues with CHECKED_PTR_OF()
Diffstat (limited to 'crypto/x509v3/v3_lib.c')
-rw-r--r--crypto/x509v3/v3_lib.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/crypto/x509v3/v3_lib.c b/crypto/x509v3/v3_lib.c
index 3ad5b29afc..dad0c905c2 100644
--- a/crypto/x509v3/v3_lib.c
+++ b/crypto/x509v3/v3_lib.c
@@ -90,9 +90,9 @@ static int ext_cmp(const X509V3_EXT_METHOD * const *a,
}
DECLARE_OBJ_BSEARCH_CMP_FN(const X509V3_EXT_METHOD *, const X509V3_EXT_METHOD *,
- ext_cmp);
+ ext);
IMPLEMENT_OBJ_BSEARCH_CMP_FN(const X509V3_EXT_METHOD *,
- const X509V3_EXT_METHOD *, ext_cmp);
+ const X509V3_EXT_METHOD *, ext);
const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid)
{
@@ -101,9 +101,7 @@ const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid)
int idx;
if(nid < 0) return NULL;
tmp.ext_nid = nid;
- ret = OBJ_bsearch(const X509V3_EXT_METHOD *, &t,
- const X509V3_EXT_METHOD *, standard_exts,
- STANDARD_EXTENSION_COUNT, ext_cmp);
+ ret = OBJ_bsearch_ext(&t, standard_exts, STANDARD_EXTENSION_COUNT);
if(ret) return *ret;
if(!ext_list) return NULL;
idx = sk_X509V3_EXT_METHOD_find(ext_list, &tmp);