thirdparty: improve -cstrict -cc clang-18 -prod compatibility for programs that do import net.mbedtls

This commit is contained in:
Delyan Angelov 2025-02-10 21:18:36 +02:00
parent e129ec5b7a
commit dacc738c96
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED
4 changed files with 18 additions and 15 deletions

View file

@ -1582,26 +1582,30 @@ static inline mbedtls_ssl_srtp_profile mbedtls_ssl_check_srtp_profile_value
#if defined(MBEDTLS_X509_CRT_PARSE_C)
static inline mbedtls_pk_context *mbedtls_ssl_own_key( mbedtls_ssl_context *ssl )
{
if( NULL == ssl) return NULL;
mbedtls_ssl_key_cert *key_cert;
if( ssl->handshake != NULL && ssl->handshake->key_cert != NULL )
if( ssl->handshake != NULL && ssl->handshake->key_cert != NULL ) {
key_cert = ssl->handshake->key_cert;
else
} else {
if( NULL == ssl->conf ) return NULL;
key_cert = ssl->conf->key_cert;
return( key_cert == NULL ? NULL : key_cert->key );
}
if( NULL == key_cert) return NULL;
return key_cert->key;
}
static inline mbedtls_x509_crt *mbedtls_ssl_own_cert( mbedtls_ssl_context *ssl )
{
if( NULL == ssl) return NULL;
mbedtls_ssl_key_cert *key_cert;
if( ssl->handshake != NULL && ssl->handshake->key_cert != NULL )
if( ssl->handshake != NULL && ssl->handshake->key_cert != NULL ) {
key_cert = ssl->handshake->key_cert;
else
} else {
if( NULL == ssl->conf ) return NULL;
key_cert = ssl->conf->key_cert;
return( key_cert == NULL ? NULL : key_cert->cert );
}
if( NULL == key_cert) return NULL;
return key_cert->cert;
}
/*