[FFmpeg-devel] [PATCH] avformat/mov: add support for multiple decryption keys

Adrien Guinet adrien at guinet.me
Mon Nov 13 10:35:29 EET 2023


On 11/12/23 18:18, Michael Niedermayer wrote:
> On Sun, Nov 12, 2023 at 06:06:01PM +0100, Adrien Guinet wrote:
>> This commit introduces new options to support more than one decryption
>> keys:
>> * add a decryption_keys option to MOV, that supports a dictionnary of
>>    KID=>key (in hex), using AV_OPT_TYPE_DICT
>> * add the corresponding cenc_decryption_keys option to DASH
>>
>> Signed-off-by: Adrien Guinet <adrien at guinet.me>
>> ---
>>   doc/demuxers.texi                          | 12 +++-
>>   libavformat/dashdec.c                      |  6 +-
>>   libavformat/isom.h                         |  5 +-
>>   libavformat/mov.c                          | 80 ++++++++++++++++++----
>>   tests/fate/mov.mak                         | 12 ++++
>>   tests/ref/fate/mov-3elist-encrypted-kid    | 57 +++++++++++++++
>>   tests/ref/fate/mov-frag-encrypted-kid      | 57 +++++++++++++++
>>   tests/ref/fate/mov-tenc-only-encrypted-kid | 57 +++++++++++++++
>>   8 files changed, 269 insertions(+), 17 deletions(-)
>>   create mode 100644 tests/ref/fate/mov-3elist-encrypted-kid
>>   create mode 100644 tests/ref/fate/mov-frag-encrypted-kid
>>   create mode 100644 tests/ref/fate/mov-tenc-only-encrypted-kid
>>
>> diff --git a/doc/demuxers.texi b/doc/demuxers.texi
>> index ca1563abb0..9d0ab6025c 100644
>> --- a/doc/demuxers.texi
>> +++ b/doc/demuxers.texi
>> @@ -281,7 +281,11 @@ This demuxer accepts the following option:
>>   @table @option
>>    @item cenc_decryption_key
>> -16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption
>> (CENC/AES-128 CTR; ISO/IEC 23001-7).
>> +Default 16-byte key, in hex, to decrypt files encrypted using ISO Common
>> Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
> 
> error: corrupt patch at line 51
> 
> [...]

Erf.. I think thunderbird reformatted the whole thing. That's my first 
patch ever sent to ffmpeg, sorry about this. Let me use git send-email 
directly...


More information about the ffmpeg-devel mailing list