RT: 3149 Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 4d3fa06fce52682bfbc503c7ded2d0289e3f8cde)