-
Notifications
You must be signed in to change notification settings - Fork 38
Privatize functions and some types/macros in cipher.h #259
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
base: development
Are you sure you want to change the base?
Privatize functions and some types/macros in cipher.h #259
Conversation
Signed-off-by: Felix Conway <[email protected]>
Signed-off-by: Felix Conway <[email protected]>
A lot more types & macros could probably be privatized too, however doing so would break the CI for other reasons. e.g. |
I think we should try to find a reasonable compromise between the two. We don't have time to spend hours analyzing every single macro. But we should take quick wins. For example, I wouldn't insist on doing this kind of analysis for all macros, especially for ones that are used in more places or in more complex ways. But I'd prefer to privatize macros when the analysis and fix is as easy as this case. |
Signed-off-by: Felix Conway <[email protected]>
Sounds good - I've re-privatized those two macros then. I can't see any other macros/types that are privatized as easily, so the ones privatized in this PR should be the complete list - on my end at least. |
Privatizes all functions and some types/macros (below) by guarding them with
MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS
. Any types/macros not listed/privatized here will break the build if they are privatized.Types privatized:
mbedtls_cipher_padding_t
enum that includes MBEDTLS_KEY_LENGTH_<NONE|DES|DES_EDE|DES_EDE3>
Macros privatized:
MBEDTLS_CIPHER_VARIABLE_IV_LEN
MBEDTLS_CIPHER_VARIABLE_KEY_LEN
MBEDTLS_KEY_BITLEN_SHIFT
(required unlinking from Doxygen comment)MBEDTLS_IV_SIZE_SHIFT
(required unlinking from Doxygen comment)Resolves #220
PR checklist
MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS