mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-07-30 16:26:33 +08:00
Merge 66de3049019e61a155c4aff93a76e1b9825691c2 into f4a1aceb8ca7198b11447d6e1885ce70feb2dcc6
This commit is contained in:
commit
7fafb1760c
7
ChangeLog.d/mbedtls_ssl_set_hostname.txt
Normal file
7
ChangeLog.d/mbedtls_ssl_set_hostname.txt
Normal file
@ -0,0 +1,7 @@
|
||||
Bugfix
|
||||
* Fix mbedtls_ssl_set_hostname(ssl, NULL) causing the connection to
|
||||
fail when compiled with some versions of IAR in configurations
|
||||
with MBEDTLS_SSL_SERVER_NAME_INDICATION disabled. Also fix
|
||||
mbedtls_ssl_set_hostname(ssl, "") which could disable hostname
|
||||
verification instead of requiring an empty hostname when compiled
|
||||
with some optimizing compilers. Fixes #10842.
|
||||
@ -2789,7 +2789,7 @@ void mbedtls_ssl_conf_groups(mbedtls_ssl_config *conf,
|
||||
* mbedtls_ssl_set_hostname() has been called with `NULL`.
|
||||
* If mbedtls_ssl_set_hostname() has never been called on `ssl`, then
|
||||
* `ssl->hostname == NULL`. */
|
||||
static const char *const ssl_hostname_skip_cn_verification = "";
|
||||
static const char *const ssl_hostname_skip_cn_verification[] = { 0 };
|
||||
|
||||
#if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED)
|
||||
/** Whether mbedtls_ssl_set_hostname() has been called.
|
||||
@ -2820,7 +2820,7 @@ static
|
||||
#endif
|
||||
const char *mbedtls_ssl_get_hostname_pointer(const mbedtls_ssl_context *ssl)
|
||||
{
|
||||
if (ssl->hostname == ssl_hostname_skip_cn_verification) {
|
||||
if (ssl->hostname == (char *) ssl_hostname_skip_cn_verification) {
|
||||
return NULL;
|
||||
}
|
||||
return ssl->hostname;
|
||||
@ -2830,7 +2830,7 @@ const char *mbedtls_ssl_get_hostname_pointer(const mbedtls_ssl_context *ssl)
|
||||
static void mbedtls_ssl_free_hostname(mbedtls_ssl_context *ssl)
|
||||
{
|
||||
if (ssl->hostname != NULL &&
|
||||
ssl->hostname != ssl_hostname_skip_cn_verification) {
|
||||
ssl->hostname != (char *) ssl_hostname_skip_cn_verification) {
|
||||
mbedtls_zeroize_and_free(ssl->hostname, strlen(ssl->hostname));
|
||||
}
|
||||
ssl->hostname = NULL;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user