Details
Description
OpenSSL 1 vs 3 difference in escaping for ISSUER string complicating migration from 1 to 3
Migration to MariaDB + a supported SSL lib needed a solution to the problem of MariaDB+OpenSSL 1 behaving differently in parsing/matching the ISSUER compared to MariaDB+OpenSSL 3. WolfSSL behaves the same as OpenSSL 1 in this regard.
As there is no way to make the same user compatible on both OpenSSL versions given Issuer string has forward slashes and with OpenSSL 3 MariaDB compares a version with escapes to the stored version without escapes (and without escapes works with OpenSSL1, with escapes breaks with OpenSSL 1).
Apparently it comes down to the use of “X509_NAME_oneline” which behaviour has changed and is not recommended to use in general. See https://manpages.opensuse.org/Leap-15.6/openssl-3-doc/X509_NAME_oneline.33ssl.en.html#NOTES.
Basically the same issue described here: https://bugs.mysql.com/bug.php?id=120912&utm_source=chatgpt.com
Attached is a docker based reproduction of the issue.
Patch context (patch itself in attachments):
Patch was applied against MariaDB Community Server 10.6.22 source (mariadb-10.6.22.tar.gz from archive.mariadb.org; Git tag mariadb-10.6.22), file sql/sql_acl.cc, function acl_check_ssl (the strcmp on X509_NAME_oneline() for issuer at line 14235 and subject at line 14252).