mbedtls_x509_crt_parse_file returns an error with negative numbers, and positive numbers indicate the number of failed certificates to load from certificate specific issues, such as critical extensions.
This would fix ticket #11079. Signed-off-by: Mohit Gupta <[email protected]> --- libavformat/tls_mbedtls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/tls_mbedtls.c b/libavformat/tls_mbedtls.c index 567b95b..97094e3 100644 --- a/libavformat/tls_mbedtls.c +++ b/libavformat/tls_mbedtls.c@@ -223,9 +223,11 @@ static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **op
// load trusted CA
if (shr->ca_file) {
- if ((ret = mbedtls_x509_crt_parse_file(&tls_ctx->ca_cert,
shr->ca_file)) != 0) {
+ if ((ret = mbedtls_x509_crt_parse_file(&tls_ctx->ca_cert,
shr->ca_file)) < 0) {
av_log(h, AV_LOG_ERROR, "mbedtls_x509_crt_parse_file for
CA cert returned %d\n", ret);
goto fail;
+ } else if (ret > 0) {
+ av_log(h, AV_LOG_DEBUG, "mbedtls_x509_crt_parse_file
skipped %d certificate(s)\n", ret);
}
}
-- 2.45.2
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ ffmpeg-devel mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
