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 D66134418F for ; Fri, 30 Sep 2022 14:31:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 217B168BBCC; Fri, 30 Sep 2022 17:31:36 +0300 (EEST) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A404E68BB39 for ; Fri, 30 Sep 2022 17:31:29 +0300 (EEST) Received: by mail-pf1-f176.google.com with SMTP id y136so4404331pfb.3 for ; Fri, 30 Sep 2022 07:31:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandflow-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date; bh=C5s63xFlhcDEFAzeeYJJAJ6zzBvgfrHvVo5A3NsFrXw=; b=G2e09zqnf67Phs6UwG/oYpEbIh5u3DqRbSxdxkaiqjfKSiVxG/s6lwbUrTdYKJcj5+ McKWQsmKeL3byvHaZfkpWXXeQcn2BS3nf4lG4ELSt13GiujWtYLKraduDn7ga1U0RGgw bzqeu82HfRgXu71UwwB4LSWkk7qaEK7Vp4AhUut4m+tc7h9QAFxdpDj/X5jDPt/8CAAx pKQP5krfYLkUv0SDP212ZdTWkbbbnsZIDzvaB5LAnMWIRvvXXORQA6acUZkjDwHpU4nw eLlq6yqSieWeukhesbhdunkJvfIWKTcYidaSqELC2GxjUc3MPxj5xk/07CPSYmN0UUYK 2NFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=C5s63xFlhcDEFAzeeYJJAJ6zzBvgfrHvVo5A3NsFrXw=; b=uWzgM9NbS12NtqSf2eX4sG0WsohId5ZrImhDGMK8EGsA361QnSWx+KDxzqY51uH9a9 /stm3VI6g8wEyZnUY410VTen930bLrb/Z0TBXnj1CVdLCVqtwZo+KSWTEQpondzaEBGo +OuU9McvayqOfGpVP9WT86Jt5XjcrD14EvfKluS8H2e4HfDEt3DxzOyI5W4mJv6FUrHZ 7d02VjuhSp8e/zy8bTzG/B4bGkXH9iCQuA5pef7+b5SFjJF9fnqKHIhx13Qj5QY8LRI+ JxFJeZRZALwIR6J1Md2p7MSEFfUBlFLEM02/Bf006cHn/VOf1Zzkh3Y6Idqo7yKqCcj+ xmIA== X-Gm-Message-State: ACrzQf0avW0TWlFqpW2rWelQz3mEqQuJTwqy9MNuOp0wDY4Lmks7o9tM LtXXpV+gS0b6++dTVIrIuJHhZ+/wDEZY0A== X-Google-Smtp-Source: AMsMyM5iiaK2ErdHROeZTehKNcxmebs3pP/1XhVzcGgAk9Jhc/38ykyqiRxkE/7Lux5/nWCdNyYI8g== X-Received: by 2002:aa7:9851:0:b0:53e:87eb:1ffa with SMTP id n17-20020aa79851000000b0053e87eb1ffamr9373950pfq.35.1664548287107; Fri, 30 Sep 2022 07:31:27 -0700 (PDT) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com. [209.85.216.52]) by smtp.gmail.com with ESMTPSA id y25-20020aa78f39000000b0053e7d3b8d6dsm1860055pfr.1.2022.09.30.07.31.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Sep 2022 07:31:26 -0700 (PDT) Received: by mail-pj1-f52.google.com with SMTP id x1-20020a17090ab00100b001fda21bbc90so9251389pjq.3 for ; Fri, 30 Sep 2022 07:31:26 -0700 (PDT) X-Received: by 2002:a17:902:f541:b0:176:e8f1:cd57 with SMTP id h1-20020a170902f54100b00176e8f1cd57mr9102553plf.8.1664548285754; Fri, 30 Sep 2022 07:31:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pierre-Anthony Lemieux Date: Fri, 30 Sep 2022 07:31:13 -0700 X-Gmail-Original-Message-ID: Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH] Encrypted SMPTE DC MXF - additional UL needed to unpack EKLV packet 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Fri, Sep 30, 2022 at 7:08 AM Richard Ayres wrote: > > We had an issue where ffmpeg was unable to unpack the EKLV of an encrypted 3D SMPTE DC MXF. > > The patch adds the SMPTE UL for EKLV packets (060e2b34.02040101.0d010301.027e0100), to mxfdec.c in order to unpack an EKLV packet found within an Encrypted SMPTE Digital Cinema MXF. > > Signed-off-by: Richard Ayres > --- > libavformat/mxfdec.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c > index badd2be224..ebd64b1c68 100644 > --- a/libavformat/mxfdec.c > +++ b/libavformat/mxfdec.c > @@ -343,6 +343,7 @@ static const uint8_t mxf_apple_coll_prefix[] = { 0x06,0x0e,0x2b,0x > /* complete keys to match */ > static const uint8_t mxf_crypto_source_container_ul[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x09,0x06,0x01,0x01,0x02,0x02,0x00,0x00,0x00 }; > static const uint8_t mxf_encrypted_triplet_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x04,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x7e,0x01,0x00 }; > +static const uint8_t mxf_encrypted_triplet_smpte_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x04,0x01,0x01,0x0d,0x01,0x03,0x01,0x02,0x7e,0x01,0x00 }; > static const uint8_t mxf_encrypted_essence_container[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0b,0x01,0x00 }; > static const uint8_t mxf_sony_mpeg4_extradata[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00 }; > static const uint8_t mxf_ffv1_extradata[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x04,0x01,0x06,0x0c,0x01,0x00,0x00,0x00 }; // FFV1InitializationMetadata > @@ -3738,6 +3739,7 @@ static int mxf_read_header(AVFormatContext *s) > PRINT_KEY(s, "read header", klv.key); > av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset); > if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key) || > + IS_KLV_KEY(klv.key, mxf_encrypted_triplet_smpte_key) || Calling one UL "mxf_encrypted_triplet_key" and the other "mxf_encrypted_triplet_smpte_key" is misleading IMHO. The only difference is the version byte, which should be ignored in most, if not all, SMPTE UL comparisons. I would instead use mxf_match_uid(), which ignores the version byte, to compare the UL keys. > IS_KLV_KEY(klv.key, mxf_essence_element_key) || > IS_KLV_KEY(klv.key, mxf_canopus_essence_element_key) || > IS_KLV_KEY(klv.key, mxf_avid_essence_element_key) || > @@ -3983,7 +3985,8 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt) > pos = klv.next_klv - klv.length; > PRINT_KEY(s, "read packet", klv.key); > av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset); > - if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key)) { > + if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key) || > + IS_KLV_KEY(klv.key, mxf_encrypted_triplet_smpte_key)) { > ret = mxf_decrypt_triplet(s, pkt, &klv); > if (ret < 0) { > av_log(s, AV_LOG_ERROR, "invalid encoded triplet\n"); > -- > 2.25.1 > > This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email and any attachments is strictly prohibited. If you receive this email in error, please immediately notify the sender by return email and permanently delete the original, any copy and any printout thereof. The integrity and security of e-mail cannot be guaranteed. > _______________________________________________ > 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". _______________________________________________ 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".