-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add accessor (getter/setter) function for MBEDTLS_PRIVATE #9716
Comments
TLS
Sorry, I don't understand: how would that be different from
Our assumption here is that the application code sets the bio functions, so it doesn't need a getter for them. Admittedly that doesn't necessarily work if the application uses an autonomous module that needs the information. Why would you need the io functions for logging though?
Again, our assumption is that the application passed those parameters so it can pass them again. But I can see the usefulness for a callback, and no risk with exposing those. We can do that in 3.6. Starting with 4.0 those fields probably won't exist any longer, just call X.509
I don't see any harm in exposing PK
That one is a problem: the pk module tries to hide the underlying representation, so that as much as possible, applications can work indifferently with RSA/ECC keys and with transparent/opaque keys. We're already exposing more than we'd like from So I don't think we should expose this. But I am sure that you're asking this because you have a problem that you can't solve with the current API. What problem are you trying to solve? Let's try to find a better interface that would still work in Mbed TLS 4.x. |
@gilles-peskine-arm Thanks for your long and detailed response. I try to give more detailed usage for the open questions. TLS
In case of failure, it would be possible to have a extended logging if we get the data from the peer certificate of the X.509
From what I see, we wouldn't need PK
I double checked it, seems like we are only using |
It's the opposite: |
Suggested enhancement
I'm migrating from MBedTLS 2.28.x to 3.6.x. During that I found a few private struct members we are using, and where I didn't found any accessor function. I found this list (is it still up2date?) and went through some issue, but perhaps I missed some accessor functions, which are already decided not to be added.
mbedtls_ssl_get_peer_cert()
mbedtls_ecp_export()
exportsgrp
,d
andQ
as a copy from the given keypair. However, we would need to modify these withinmbedtls_ecp_keypair
. Is it possible to have a getter, which returns a pointer to the corresponding struct element, or a setter, to copy a modified export back into the keypair?Justification
For specific logging, we would need from
mbedtls_ssl_context
as getter,peer_cert
ofsession_negotiate
(e.g. similar function likembedtls_ssl_get_peer_cert()
andin_msg
.A getter for
p_bio
inmbedtls_ssl_context
to access the own defined struct to access I/O operations. I found a setter but now getter.To take some more parameters into account we do have a function for validation of x509 signature. We are using
mbedtls_md_info_from_type()
andmbedtls_pk_verify()
, however we would need to access for these functionsig
andsig_md
from the structmbedtls_x509_crt
.mbedtls_pk_info_from_type()
for a given type is possible, but not thepk_info
ofmbedtls_pk_context
is returned. We would need the actuallypk_info
.For
mbedtls_pk_parse_key
both,f_rng
andp_rng
ofmbedtls_ssl_config
are necessary. As we are usingmbedtls_pk_parse_key
in our implementation in creating a own TLS container and setting the certificate there. For this function we would need the random number generator function.The text was updated successfully, but these errors were encountered: