https://bugs.openldap.org/show_bug.cgi?id=9920
--- Comment #17 from kero renault.cle@gmail.com --- It's me again. After further investigation, I tried using eax encryption with an auth data size of 4 and 0. Both failed, so the issue doesn't seem to relate only to the auth data size.
When trying with an auth data size of 0, it went further in the process but crashed with the following error: sometimes an MDB_CURSOR_FULL, MDB_PAGE_NOTFOUND, or an MDB_CORRUPTED error, a bus error, or other times even the following assertion:
mdb.c:9072: Assertion 'MP_UPPER(mp) >= MP_LOWER(mp)' failed in mdb_node_add()
MDB_CURSOR_FULL: Internal error - cursor stack limit reached
MDB_CURSOR_FULL: Internal error - cursor stack limit reached
MDB_CORRUPTED: Located page was wrong type
In conclusion, the auth data size is not the only problem. Even if I set it to 0 and never write the tag out, it corrupts the database. However, I couldn't reproduce the issue with a zero-length auth data buffer in the mtest_enc.c test even with 6.4M entries.