From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id EDD1E48810 for ; Sat, 18 May 2024 19:54:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7984068CCDC; Sat, 18 May 2024 22:54:02 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0D7B368C533 for ; Sat, 18 May 2024 22:53:55 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 51BA91BF204 for ; Sat, 18 May 2024 19:53:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716062035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PlOB9Lve3gJyJ/IaQ5Czhb8ApfyaJB7Tyk/Uow5tCeY=; b=cJf4YVSkfhSClPbmHL5+u50vXpx7fb9VbvlBqZV6td6yOpJ6YCerEu00bCMP9+WAY/CeQW C4QM1dJkdlxTH5PFTbNtUtCOX6S1X5fdRniDp98hTzYaCwzpMgcJghKwyGrwV2evWBZ+6U gLLLCbkBs7fBun7NMAKg4x0Sapu4uWcUbbveMJQr0Of/2wVCEB0MrXa+5riWSCb8XaQBLg rLxxndgPRjR5FmvKbn2Ir5z1AsZfoGJ/LzlxY+mQx5VhJHjyp910/YxYYrUglsq6fx3qEo /jXnNAqVMyBNkoI07mihcaBBmpUfUXj4LxQifjzw1lTi237QhAbTsIucRqhj8A== Date: Sat, 18 May 2024 21:53:54 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240518195354.GD2821752@pb2> References: MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 4/6] lavf/tls_mbedtls: fix handling of certification validation failures X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============8253786649413968643==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8253786649413968643== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Qrgsu6vtpU/OV/zm" Content-Disposition: inline --Qrgsu6vtpU/OV/zm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 17, 2024 at 10:34:41AM +0200, Sfan5 wrote: > We manually check the verification status after the handshake has complet= ed > 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. >=20 > Signed-off-by: sfan5 > --- > libavformat/tls_mbedtls.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > 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, i= nt > 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 [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answe= r. --Qrgsu6vtpU/OV/zm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZkkHUgAKCRBhHseHBAsP q2FOAJ9pLKENBKHLVq0eiPVF+vJnZqTp9gCdGicDcbY3Rb86PkwINf6ZKlGHabA= =rcQF -----END PGP SIGNATURE----- --Qrgsu6vtpU/OV/zm-- --===============8253786649413968643== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============8253786649413968643==--