Apply suggestions from code review

Co-authored-by: Scott Shawcroft <scott@tannewt.org>
This commit is contained in:
Tim Hawes 2021-12-14 20:03:44 +00:00 committed by GitHub
parent c325633f8e
commit 54e87d3660
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 10 deletions

View File

@ -81,17 +81,9 @@ void common_hal_ssl_sslcontext_set_default_verify_paths(ssl_sslcontext_obj_t *se
}
bool common_hal_ssl_sslcontext_get_check_hostname(ssl_sslcontext_obj_t *self) {
if (self->ssl_config.skip_common_name) {
return 0;
} else {
return 1;
}
return !self->ssl_config.skip_common_name;
}
void common_hal_ssl_sslcontext_set_check_hostname(ssl_sslcontext_obj_t *self, bool value) {
if (value) {
self->ssl_config.skip_common_name = 0;
} else {
self->ssl_config.skip_common_name = 1;
}
self->ssl_config.skip_common_name = !value;
}