Hi,
While working on updating mbedtls to v3.0, I saw that the internal fields in MBEDTLS have been made private. ( ref- here).
It says there and I quote
"As a last resort, you can access the field foo
of
a structure bar
by
writing bar.MBEDTLS_PRIVATE(foo)
.
Note that you do so at your own risk, since such code is likely to break in a future minor version of Mbed TLS.”
I just wanted to know if there is any alternative solution to this,
rather than using `MBEDTLS_PRIVATE` everywhere. I know the next release of mbedtls probably plans to fix this with appropriate solution. But we wanted to push out our feature branch As early as possible.
I saw in the PR in
zephyr RTOS about updating to mbedtls-3.0. They have just added this line
#if !defined(MBEDTLS_ALLOW_PRIVATE_ACCESS)
#define
MBEDTLS_ALLOW_PRIVATE_ACCESS |
# endif
Is this an alternative solution to using `MBEDTLS_PRIVATE` for accessing a private field. If yes, can somebody please point me to respective document as this would greatly reduce our code-changes.
I understand there is some discussion going on in mbedtls about this change, and appropriate getter-setter functions shall be provided. But we wanted to push out out feature branch for early testing.
Thanks and Regards,
Aditya