Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Anton Khirnov <anton@khirnov.net>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] lavf/tls_mbedtls: fix handling of tls_verify=0
Date: Thu, 30 Dec 2021 12:03:59 +0100
Message-ID: <164086223930.2375.12892810171860073873@lain.red.khirnov.net> (raw)
In-Reply-To: =?utf-8?q?=3CDB9PR09MB521280779042915CB11BDC14EC449=40DB9PR09MB?= =?utf-8?q?5212=2Eeurprd09=2Eprod=2Eoutlook=2Ecom=3E?=

Quoting sfan5 (2021-12-29 23:12:37)
> On 29.12.2021 at 21:02 Anton Khirnov wrote:
> > Quoting sfan5 (2021-12-13 21:55:41)
> >> If ca_file was set, setting tls_verify=0 would not actually disable
> >> verification.
> >>
> >>  From 2677353187c4e3c20b50a3f9aab53130e3ead99b Mon Sep 17 00:00:00 2001
> >> From: sfan5 <sfan5@live.de>
> >> Date: Mon, 13 Dec 2021 21:35:40 +0100
> >> Subject: [PATCH] lavf/tls_mbedtls: fix handling of tls_verify=0
> >>
> >> If ca_file was set, setting tls_verify=0 would not actually disable verification.
> >> ---
> >>   libavformat/tls_mbedtls.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/libavformat/tls_mbedtls.c b/libavformat/tls_mbedtls.c
> >> index aadf17760d..5754d0d018 100644
> >> --- a/libavformat/tls_mbedtls.c
> >> +++ b/libavformat/tls_mbedtls.c
> >> @@ -223,7 +223,7 @@ static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **op
> >>       }
> >>   
> >>       mbedtls_ssl_conf_authmode(&tls_ctx->ssl_config,
> >> -                              shr->ca_file ? MBEDTLS_SSL_VERIFY_REQUIRED : MBEDTLS_SSL_VERIFY_NONE);
> >> +                              shr->verify ? MBEDTLS_SSL_VERIFY_REQUIRED : MBEDTLS_SSL_VERIFY_NONE);
> >>       mbedtls_ssl_conf_rng(&tls_ctx->ssl_config, mbedtls_ctr_drbg_random, &tls_ctx->ctr_drbg_context);
> >>       mbedtls_ssl_conf_ca_chain(&tls_ctx->ssl_config, &tls_ctx->ca_cert, NULL);
> >>   
> >> -- 
> >> 2.34.1
> > What will happen if verify=1, but ca_file is not set?
> >
> The verification fails as expected and mbedtls_ssl_handshake returns an 
> error, just tested.

Then patch looks good

-- 
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2021-12-30 11:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <DB9PR09MB5212F20AA1CC818151577A11EC749@DB9PR09MB5212.eurprd09.prod.outlook.com>
2021-12-27 11:52 ` sfan5
2021-12-29 20:02 ` Anton Khirnov
2021-12-29 22:12   ` sfan5
2021-12-30 11:03   ` Anton Khirnov [this message]
2021-12-30 17:44 ` Jan Ekström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=164086223930.2375.12892810171860073873@lain.red.khirnov.net \
    --to=anton@khirnov.net \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git