1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

x509: Added mbedtls_x509_crt_get_ca_istrue() API accessor.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
Minos Galanakis
2024-01-18 17:05:21 +00:00
parent e33b349c90
commit 2abbac74dc
2 changed files with 20 additions and 0 deletions

View File

@ -3290,4 +3290,12 @@ void mbedtls_x509_crt_restart_free(mbedtls_x509_crt_restart_ctx *ctx)
}
#endif /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */
int mbedtls_x509_crt_get_ca_istrue(const mbedtls_x509_crt *crt)
{
if ((crt->ext_types & MBEDTLS_X509_EXT_BASIC_CONSTRAINTS) != 0) {
return crt->MBEDTLS_PRIVATE(ca_istrue);
}
return MBEDTLS_ERR_X509_INVALID_EXTENSIONS;
}
#endif /* MBEDTLS_X509_CRT_PARSE_C */