summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_methods.c
diff options
context:
space:
mode:
authortb <>2023-11-11 09:35:21 +0000
committertb <>2023-11-11 09:35:21 +0000
commit04a4b9d9b4067f424283f0e5c80bcd9ea6aff6c0 (patch)
tree6220c6b10ffd4dcbf53f7871348f8e717039ce94 /src/lib/libssl/ssl_methods.c
parent34a76fe207a0f8a739b7c8501991143e58861fbf (diff)
downloadopenbsd-04a4b9d9b4067f424283f0e5c80bcd9ea6aff6c0.tar.gz
openbsd-04a4b9d9b4067f424283f0e5c80bcd9ea6aff6c0.tar.bz2
openbsd-04a4b9d9b4067f424283f0e5c80bcd9ea6aff6c0.zip
Fix a few bugs in X509v3_asid_add*()
These 'builder' functions, usually used together, can result in corrupt ASIdentifiers on failure. In general, no caller should ever try to recover from OpenSSL API failure. There are simply too many traps. We can still make an effort to leave the objects in unmodified state on failure. This is tricky because ownership transfer happens. Unfortunately a really clean version of this seems impossible, maybe a future iteration will bring improvements... The nasty bit here is that the caller of X509v3_asid_add_id_or_range() can't know from the return value whether ownership of min and max was transferred or not. An inspection of (*choice)->u.range is required. If a caller frees min and max after sk_ASIdOrRange_push() failed, there is a double free. All these complications could have been avoided if the API interface had simply used uint32_t instead of ASN1_INTEGERs. The entire RFC 3779 API was clearly written without proper review. I don't know if there ever was an actual consumer before rpki-client. If it existed, nobody with the requisite skill set looked at it in depth. ok beck for the general direction with a lot of input and ok jsing
Diffstat (limited to 'src/lib/libssl/ssl_methods.c')
0 files changed, 0 insertions, 0 deletions