summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strmode.c
diff options
context:
space:
mode:
authortb <>2024-06-17 05:31:26 +0000
committertb <>2024-06-17 05:31:26 +0000
commit1cce7a8778d5b86a020d7d0546bc2401506d5117 (patch)
tree528a222420b347d3261eacb9ebc8744a2aea9e43 /src/lib/libc/string/strmode.c
parent8d9a11036e953db2041151dae4ab5fd4c82a8608 (diff)
downloadopenbsd-1cce7a8778d5b86a020d7d0546bc2401506d5117.tar.gz
openbsd-1cce7a8778d5b86a020d7d0546bc2401506d5117.tar.bz2
openbsd-1cce7a8778d5b86a020d7d0546bc2401506d5117.zip
Rewrite X509V3_get_d2i()
This API is wrapped by nine *_get{,1}_ext_d2i() functions and they all have the same defect: if an idx variable is passed in, multiple extensions are handled incorrectly. Clean up the mess that was the current implementation by replacing the reimplementation of X509v3_get_ext_by_NID() with extra twists by actual calls to the real thing. This way the madness is implemented explicitly and can be explained in comments. The code still gets shorter. In brief: always call this API with a known nid, pass crit, and a NULL idx. If NULL is returned, crit != -1 is an error (malformed cert or allocation failure). ok jsing
Diffstat (limited to 'src/lib/libc/string/strmode.c')
0 files changed, 0 insertions, 0 deletions