CVSROOT: /cvs Module name: src Changes by: schwa...@cvs.openbsd.org 2020/09/18 10:18:56
Modified files: lib/libssl : ssl_lib.c Log message: If ssl_cert_dup() fails in SSL_set_SSL_CTX(3), return failure rather than silently leaving a NULL pointer in ssl->cert. Kurt Roeckx fixed the same bug similarly in OpenSSL in 2015. While here, (1) make the code easier to read and more robust by returning right away when ssl still uses the context it was created from and the ctx argument is NULL, rather than doing a lot of work that changes nothing unless data is already corrupt, and (2) use the shorter and more inituitive SSL_CTX_up_ref(3) rather than manually calling CRYPTO_add(3), which means no functional change and is also in the OpenSSL 1.1 branch. OK tb@