-
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 getters for some fields #7216
Changes from all commits
af724dd
918ebf3
accd53f
08daebb
30e0870
db61433
5cbb93e
5a3f5f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Features | ||
* Add getter (mbedtls_ssl_cache_get_timeout()) to access | ||
`mbedtls_ssl_cache_context.timeout`. | ||
* Add getter (mbedtls_ssl_get_hostname()) to access | ||
`mbedtls_ssl_context.hostname`. | ||
* Add getter (mbedtls_ssl_conf_get_endpoint()) to access | ||
`mbedtls_ssl_config.endpoint`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1148,13 +1148,19 @@ exit: | |
/* BEGIN_CASE depends_on:MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED */ | ||
void ssl_set_hostname_twice(char *hostname0, char *hostname1) | ||
{ | ||
const char *hostname; | ||
mbedtls_ssl_context ssl; | ||
|
||
mbedtls_ssl_init(&ssl); | ||
USE_PSA_INIT(); | ||
|
||
TEST_ASSERT(mbedtls_ssl_set_hostname(&ssl, hostname0) == 0); | ||
hostname = mbedtls_ssl_get_hostname(&ssl); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really like the naming of the variables here. I know This is just my preference and I accept others may not think this is needed so I won't request changes just for this, but consider changing them if you agree. |
||
TEST_ASSERT(strcmp(hostname0, hostname) == 0); | ||
|
||
TEST_ASSERT(mbedtls_ssl_set_hostname(&ssl, hostname1) == 0); | ||
hostname = mbedtls_ssl_get_hostname(&ssl); | ||
TEST_ASSERT(strcmp(hostname1, hostname) == 0); | ||
|
||
exit: | ||
mbedtls_ssl_free(&ssl); | ||
|
@@ -3045,6 +3051,8 @@ void conf_version(int endpoint, int transport, | |
mbedtls_ssl_conf_max_tls_version(&conf, max_tls_version); | ||
|
||
TEST_ASSERT(mbedtls_ssl_setup(&ssl, &conf) == expected_ssl_setup_result); | ||
TEST_EQUAL(mbedtls_ssl_conf_get_endpoint( | ||
mbedtls_ssl_context_get_config(&ssl)), endpoint); | ||
|
||
mbedtls_ssl_free(&ssl); | ||
mbedtls_ssl_config_free(&conf); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove the commas around the word "too". Not really needed here.