Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move macro definitions out of debug.h #10054

Open
gilles-peskine-arm opened this issue Mar 11, 2025 · 2 comments
Open

Move macro definitions out of debug.h #10054

gilles-peskine-arm opened this issue Mar 11, 2025 · 2 comments
Labels
api-break This issue/PR breaks the API and must wait for a new major version component-tls size-xs Estimated task size: extra small (a few hours at most)

Comments

@gilles-peskine-arm
Copy link
Contributor

The public header file mbedtls/debug.h contains the declaration of mbedtls_debug_set_threshold, and many macro definitions. mbedtls_debug_set_threshold belongs in a public header file, but not the macro definitions. All the macro definitions are intended when calling a function to emit a debug message, and those functions aren't even declared in a public header.

The goal of this task is to move the macro definitions from include/mbedtls/debug.h to library/debug_internal.h.

@gilles-peskine-arm gilles-peskine-arm added api-break This issue/PR breaks the API and must wait for a new major version component-tls size-xs Estimated task size: extra small (a few hours at most) labels Mar 11, 2025
@gilles-peskine-arm gilles-peskine-arm moved this to Implementation needed in Mbed TLS 4.0 planning Mar 11, 2025
@mpg
Copy link
Contributor

mpg commented Mar 11, 2025

See also #6859 with a slightly bigger scope.

Perhaps the cost/benefit analysis for renaming is not favourable (I like things to be tidy, but is it worth bothering existing users?) - but we should probably consider if we really still need a public debug.h or can just move mbedtls_debug_set_threshold() to ssl.h.

@gilles-peskine-arm
Copy link
Contributor Author

Yes, I figure it's a lot easier to move a bunch of definitions than to rename a header file and update all the code and add the requisite ifdefs in mbedtls-framework and whatever else we'd need to do if we remove mbedtls/debug.h and rename mbedtls_debug_set_threshold to mbedtls_ssl_debug_set_threshold.

We could move the definition of mbedtls_debug_set_threshold to ssl.h and keep a debug.h that just includes ssl.h. But that doesn't seem particularly useful to me if we don't go bigger and also at least rename the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-break This issue/PR breaks the API and must wait for a new major version component-tls size-xs Estimated task size: extra small (a few hours at most)
Projects
Status: Implementation needed
Development

No branches or pull requests

2 participants