ossl_bsearch(): New generic internal binary search utility function
authorRichard Levitte <levitte@openssl.org>
Wed, 8 May 2019 08:40:20 +0000 (10:40 +0200)
committerRichard Levitte <levitte@openssl.org>
Wed, 8 May 2019 14:17:16 +0000 (16:17 +0200)
commit5c3f1e34b559c9b4372bf48aab63b61a6cd5edbb
tree3c6d91959d546794e32517dd5adecc8f1bbc0333
parent67c81ec311d696464bdbf4c6d6f8a887a3ddf9f8
ossl_bsearch(): New generic internal binary search utility function

OBJ_bsearch_ and OBJ_bsearch_ex_ are generic functions that don't
really belong with the OBJ API, but should rather be generic utility
functions.  The ending underscore indicates that they are considered
internal, even though they are declared publicly.

Since crypto/stack/stack.c uses OBJ_bsearch_ex_, the stack API ends up
depending on the OBJ API, which is unnecessary, and carries along
other dependencies.

Therefor, a generic internal function is created, ossl_bsearch().
This removes the unecessary dependencies.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8899)
crypto/bsearch.c [new file with mode: 0644]
crypto/build.info
crypto/objects/obj_dat.c
crypto/stack/stack.c
include/internal/cryptlib.h