void * tls_init(const struct tls_config *conf) { struct tls_global *global; if (tls_ref_count == 0) { if (tlsv1_client_global_init()) return NULL; } tls_ref_count++; global = os_zalloc(sizeof(*global)); if (global == NULL) return NULL; return global; }
void * tls_init(const struct tls_config *conf) { struct tls_global *global; if (tls_ref_count == 0) { #ifdef CONFIG_TLS_INTERNAL_CLIENT if (tlsv1_client_global_init()) return NULL; #endif /* CONFIG_TLS_INTERNAL_CLIENT */ #ifdef CONFIG_TLS_INTERNAL_SERVER if (tlsv1_server_global_init()) return NULL; #endif /* CONFIG_TLS_INTERNAL_SERVER */ } tls_ref_count++; global = os_zalloc(sizeof(*global)); if (global == NULL) return NULL; return global; }