aboutsummaryrefslogtreecommitdiff
path: root/crypto/x509v3/v3_purp.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_purp.c
parentae7ec4c71de74fa52c5d89e32e28445c6602990d (diff)
downloadopenssl-e19106f5fb7da7db15449a9a50f9be9047800757.zip
openssl-e19106f5fb7da7db15449a9a50f9be9047800757.tar.gz
openssl-e19106f5fb7da7db15449a9a50f9be9047800757.tar.bz2
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_purp.c')
-rw-r--r--crypto/x509v3/v3_purp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/x509v3/v3_purp.c b/crypto/x509v3/v3_purp.c
index a5d9805..e00c9ec 100644
--- a/crypto/x509v3/v3_purp.c
+++ b/crypto/x509v3/v3_purp.c
@@ -272,8 +272,8 @@ static int nid_cmp(const int *a, const int *b)
return *a - *b;
}
-DECLARE_OBJ_BSEARCH_CMP_FN(int, int, nid_cmp);
-IMPLEMENT_OBJ_BSEARCH_CMP_FN(int, int, nid_cmp);
+DECLARE_OBJ_BSEARCH_CMP_FN(int, int, nid);
+IMPLEMENT_OBJ_BSEARCH_CMP_FN(int, int, nid);
int X509_supported_extension(X509_EXTENSION *ex)
{
@@ -303,13 +303,13 @@ int X509_supported_extension(X509_EXTENSION *ex)
NID_inhibit_any_policy /* 748 */
};
- const int ex_nid = OBJ_obj2nid(X509_EXTENSION_get_object(ex));
+ int ex_nid = OBJ_obj2nid(X509_EXTENSION_get_object(ex));
if (ex_nid == NID_undef)
return 0;
- if (OBJ_bsearch(int, &ex_nid, int, supported_nids,
- sizeof(supported_nids)/sizeof(int), nid_cmp))
+ if (OBJ_bsearch_nid(&ex_nid, supported_nids,
+ sizeof(supported_nids)/sizeof(int)))
return 1;
return 0;
}