From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 4/6] lavf/tls_mbedtls: fix handling of certification validation failures
Date: Sat, 18 May 2024 21:53:54 +0200
Message-ID: <20240518195354.GD2821752@pb2> (raw)
In-Reply-To: <DU0PR03MB9567EEB5404C31C4A4AE7EF3ECEE2@DU0PR03MB9567.eurprd03.prod.outlook.com>
[-- Attachment #1.1: Type: text/plain, Size: 1621 bytes --]
On Fri, May 17, 2024 at 10:34:41AM +0200, Sfan5 wrote:
> We manually check the verification status after the handshake has completed
> using mbedtls_ssl_get_verify_result(). However with VERIFY_REQUIRED
> mbedtls_ssl_handshake() already returns an error, so this code is never
> reached.
> Fix that by using VERIFY_OPTIONAL, which performs the verification but
> does not abort the handshake.
>
> Signed-off-by: sfan5 <sfan5@live.de>
> ---
> libavformat/tls_mbedtls.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/tls_mbedtls.c b/libavformat/tls_mbedtls.c
> index 9508fe3436..67d5c568b9 100644
> --- a/libavformat/tls_mbedtls.c
> +++ b/libavformat/tls_mbedtls.c
> @@ -263,8 +263,9 @@ static int tls_open(URLContext *h, const char *uri, int
> flags, AVDictionary **op
> goto fail;
> }
> + // not VERIFY_REQUIRED because we manually check after handshake
> mbedtls_ssl_conf_authmode(&tls_ctx->ssl_config,
> - shr->verify ? MBEDTLS_SSL_VERIFY_REQUIRED :
> MBEDTLS_SSL_VERIFY_NONE);
> + shr->verify ? MBEDTLS_SSL_VERIFY_OPTIONAL :
> 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);
This patch looks corrupted by extra line breaks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
There will always be a question for which you do not know the correct answer.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
next prev parent reply other threads:[~2024-05-18 19:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-17 8:34 Sfan5
2024-05-18 19:53 ` Michael Niedermayer [this message]
2024-05-21 10:13 ` sfan5
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=20240518195354.GD2821752@pb2 \
--to=michael@niedermayer.cc \
--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