From patchwork Fri Sep 30 14:08:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Ayres X-Patchwork-Id: 38477 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1724459pzh; Fri, 30 Sep 2022 07:08:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Q9VPDUwLprpdx5aMc2zR9GEJS4exl/+54MHrozfG+RYyTwwRm/jxrBEIlceze14o+x2U5 X-Received: by 2002:a17:907:7215:b0:782:e880:930c with SMTP id dr21-20020a170907721500b00782e880930cmr6416721ejc.130.1664546898569; Fri, 30 Sep 2022 07:08:18 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id q5-20020a056402248500b004478e283f05si2163517eda.104.2022.09.30.07.08.17; Fri, 30 Sep 2022 07:08:18 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@bydeluxe.com header.s=selector2 header.b=nHJdnXyT; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3C95D68BBAF; Fri, 30 Sep 2022 17:08:14 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2119.outbound.protection.outlook.com [40.107.244.119]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8422168BA2F for ; Fri, 30 Sep 2022 17:08:07 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AzfrqdW+Rsz+LWuSg+iQB+WZ7D6YQPjtgeoJF5qRmaEM5GOqrXD1X7Y+W3fdH37WKG7pm7MoIbj/mx3ZhTBg3yLPZPqUqdo3/ROBQMy3fvHNSma4uKqJgoSdxpDl19kcPhBGKI7jLngtgrTj7nED5tBPTOyPPY3CNOFraocvJ3kO7DzhblSqirhi0n6edJSZzaMircRDJq7FUGwPXi8+dS1S+Bvln1jLPO7KcKYm45Xf4woWz84FdZNO6YXQL8p36Iyu0aDQeJNMuR9PiYMd/3jM61jZbfhNekoMXVFx6z7XPsIZAeiEW2BS8FKJ72EjlP3oXid83cimrSBM1f6P+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pSdMDwQN7Zc3SOhjheQs6tAty8Dsrf437OD3F+ask50=; b=LlR6Kvy5E7EN0hMKJYIk1QpIgFsDy/SEv530Bhv7MIY8z/SFjbIZr1zEcqEGwk62Jj8+vwVJoQTB/fjBmb5ns5jX9ZFe86shCkYLztP26FQucAKJV+G1qdqA6TvsOXZEdMB8roKZ2qm82+DRP3kOeNrqF290xnppH2CEKlTEDCcrO7WznfX/mg1UpCknS3svTWTySMxx10OeH586kZ4rwmWn/RJkMkkSTBKa7OtOoxWvJm7o730e7YldDTagIXA7eSTAykYl7NtFVjWD7wWMedU/7vGJl273ZCO9vgnsDGNnIRe2q7NLHRZWbxVDTwpX9FdrO7WcS11RqcZxjGVGKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bydeluxe.com; dmarc=pass action=none header.from=bydeluxe.com; dkim=pass header.d=bydeluxe.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bydeluxe.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pSdMDwQN7Zc3SOhjheQs6tAty8Dsrf437OD3F+ask50=; b=nHJdnXyTJo9GFgUI5lwtdqEOunM4yvTwQSFMs0g9AXFMpfLmWx9P6QIsudkKVQRZLTgeexsTFok0HX0+qwyZPz6WzjQ29hkTIop4WWZP8iENhRv3V8yMDdutLAQhgLFHIWabXwbXfrclh6VeeFKjbO+GLRKwBOZtLt/tXwE+x955y3CFZobxvdzRMEToFqGB0j3bRkDInTSNG5CQJlzMdJmhdJRpj/zOADHUCQcB2APQyLYqCMxClKcCWRjKzvyYc6ao7xKkzS+7FqmTKWDjzvFRNfb2yE72EUTUvDayQgoAbvbkFOnkH0USCIGIJKlBXLzecl7ajdjltMlGleCpQw== Received: from BN6PR08MB2834.namprd08.prod.outlook.com (2603:10b6:404:126::9) by DM6PR08MB4060.namprd08.prod.outlook.com (2603:10b6:5:8d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Fri, 30 Sep 2022 14:08:02 +0000 Received: from BN6PR08MB2834.namprd08.prod.outlook.com ([fe80::40f:754b:dd14:8cda]) by BN6PR08MB2834.namprd08.prod.outlook.com ([fe80::40f:754b:dd14:8cda%10]) with mapi id 15.20.5654.027; Fri, 30 Sep 2022 14:08:02 +0000 From: Richard Ayres To: "ffmpeg-devel@ffmpeg.org" Thread-Topic: [PATCH] Encrypted SMPTE DC MXF - additional UL needed to unpack EKLV packet Thread-Index: AQHY1NImGKpML/NQXUSyON6VmnQLkA== Date: Fri, 30 Sep 2022 14:08:01 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=bydeluxe.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN6PR08MB2834:EE_|DM6PR08MB4060:EE_ x-ms-office365-filtering-correlation-id: e38f2997-a9ff-42ea-3b14-08daa2ed2fda x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PfqTcWW2QEKGVE0xokDHvnWf1x4uP0VPqnn6KEw6SUQMXPXsNSAgZyUjOleOPwJVO5SsKiT6kR1WePgVWrD/oKp+GVshqt0YjrzkwiwX5GJ8s9AyKsmMSH4SmPXjNaccKyYNnMTKtjW3dFSPmvFnluPgpSHQ6+mxRk7CzFsRUbb9akW5i+oldSWCsnO8M1wH17u6v5T83/1eypztoNjHJSyKL0o2DJdFcMdnHpWlbkCo8C9HucqjapKGM45xH1ZgWCnfJCMcmcyOjjMv/d52NgfFKU6eK88oR7O78LSdeFjrCphPL2SOzEiECmK8TGr/yjZ3ymTNRcmcj1xyijDP7FA3dQsT8a0qr7iZktB21awSDFLlmLZbzNjivIuxo9zaCkHfA9xTvD8ubOzRynqhmA/3sgF4PUp9fd2kTaEgyDjNQtS1LJW66T0YU6OwUgn/K/zOEw3Gh/Jj6V9trunOpG1G7wbjzQNStGJSvEKoRGP66Tof7QgUrQffh8sD7A9WzLW8R6ntW6h+sduKkQR0pqoeQ5JLxwqFmQqYV8m01I9D0yPuRz6fgdOsDodBEfwhjrWtwuffgFM+SkGRUwlIEmTGsaBv1EkV7iPWY3qB0U6k44afM8hPSPTvtzPDMensLq9oIWTWyGNXr3+0ES9pS7KsmQtuKUgKcA/fVmzoj3SIUX1lzGfGeoJWNp1aedoKcZPDpr8yrwtyudNyO1IrQ6NTHN2FrOE+E/saJ8Bl+lWJevTHO6iUNLbPfVnf6b4E x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR08MB2834.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(136003)(376002)(346002)(39860400002)(451199015)(8936002)(41300700001)(52536014)(91956017)(66946007)(76116006)(122000001)(66556008)(316002)(64756008)(5660300002)(66446008)(9686003)(66476007)(26005)(8676002)(2906002)(33656002)(478600001)(38100700002)(83380400001)(6916009)(71200400001)(55016003)(86362001)(38070700005)(186003)(6506007)(7696005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?XbBE5V2ipnB5k7ZEcOS/gRG?= =?iso-8859-1?q?tIjf2bpdWP5EWqY9pYtiLjpl5V53PInfn0qTLa/5qW7M93FYW7AUA24d/puy?= =?iso-8859-1?q?LcwVffjaj6DB57UPXhmKvIH1gBZukC8oqSHE7HDJkf14QGAJMJiVgSjno5NX?= =?iso-8859-1?q?ZXfJl+bSNGZwPhU3VOUHrJYYUahT8QwNOuAmI9VmXcKp26TlcW9hbr0rHcwf?= =?iso-8859-1?q?WThcVtnvMktgv3EBxsECmvR6kuc3Cn9WEO0lzuS1jXFoy+4nMDeO00vn9OoN?= =?iso-8859-1?q?71w5+UAhneBeRsILoLkd6doxirazeUVrZHvc98azcfTMBV7T+Rhrcl9Tjbw8?= =?iso-8859-1?q?EOX9AjcaKlEm8GrKT3hRRJx8/0mpzO9V4uzhu4gJiTfX+50H8HQOKDKfAJso?= =?iso-8859-1?q?j+KA2NdRn1b1P9eOYFgLginVa3CS0qVN340CWD3F2lHoAayufupKwxKlkb+W?= =?iso-8859-1?q?MJ9bIO+zSMJQwusfSXO8n4VuLFJhkLMteujTYaP5uonycldFtejjvCBv490W?= =?iso-8859-1?q?+vBdRFdFYhYMJ0AqQZJ0bJCEmQQtexsF8enAS1+Kw6gJuUaYpJ4oWLndlWKw?= =?iso-8859-1?q?jQqBN4Q0xFC/Sms5i0Gc2F1VGHgAgoT7OywAutVVmPlsUQhH8SE4FXCZ4dxV?= =?iso-8859-1?q?4RcOc1hgfXgHzA9rZ2Hvlu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+nXxFTc4?= =?iso-8859-1?q?1ePIJI66bTRKwuLZHwFNXLuKJTz/CafHxWTjH2FbrEZzmF1cYSSy0PXkAEKW?= =?iso-8859-1?q?stdteWWOW1Z6WVMty?= MIME-Version: 1.0 X-OriginatorOrg: bydeluxe.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR08MB2834.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e38f2997-a9ff-42ea-3b14-08daa2ed2fda X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Sep 2022 14:08:01.9657 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8688c7c4-1f2a-4115-a918-361023dde469 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: YL+BOKnJCsH047zfSZ8uT5nmnQLtan+RFy4HtRwqCzCfEYi+rzDQWadg2Epp6h5NydR7J6jgI1H74J/GCHZW+2jMRnk29YJVgFuLv8W4nkc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR08MB4060 Subject: [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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: KIoT/vx7VNxB 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 Signed-off-by: Richard Ayres --- libavformat/mxfdec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 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. 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) || 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");