summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/cryptlib.c
diff options
context:
space:
mode:
authortb <>2023-12-13 23:28:47 +0000
committertb <>2023-12-13 23:28:47 +0000
commit5485638c7c81842ea6a037084beba5d59aec9ba4 (patch)
treefaf01ccc412436a5a29e820afbb97b6c664000be /src/lib/libcrypto/cryptlib.c
parent6754a5670621a3f0b1bd0eda9d4f1a191a4cd016 (diff)
downloadopenbsd-5485638c7c81842ea6a037084beba5d59aec9ba4.tar.gz
openbsd-5485638c7c81842ea6a037084beba5d59aec9ba4.tar.bz2
openbsd-5485638c7c81842ea6a037084beba5d59aec9ba4.zip
Simplify OBJ_obj2nid()
Continue with OBJ_bsearch_() elimination. OBJ_obj2nid() first checks if the object identifier passed in has a nid and if so, it returns that. Otherwise, it looks into the global hash of added objects (of course without locking) for a match and then returns the nid thereof. As a last attempt, it searches the table of built-in object identifiers. The last two steps can be cleaned up and simplified quite a bit by using C99 initializers, bsearch() and an appropriate comparison function. Then it becomes obvious that bsearch() already returns a pointer to the nid we're looking for, so there is no point in converting that into its corresponding obj and returning the nid thereof. ok jsing
Diffstat (limited to 'src/lib/libcrypto/cryptlib.c')
0 files changed, 0 insertions, 0 deletions