Changes of Revision 2

ffmpeg-support-kid-key.patch Added
x
 
1
@@ -0,0 +1,454 @@
2
+--- a/doc/demuxers.texi
3
++++ b/doc/demuxers.texi
4
+@@ -281,7 +281,11 @@
5
+ @table @option
6
+ 
7
+ @item cenc_decryption_key
8
+-16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
9
++Default 16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
10
++
11
++ at item cenc_decryption_keys
12
++Dictionary of 16-byte key ID => 16-byte key, both in hex, to decrypt files encrypted using ISO Common Encryption
13
++(CENC/AES-128 CTR; ISO/IEC 23001-7).
14
+ 
15
+ @end table
16
+ 
17
+@@ -931,7 +935,11 @@
18
+ specify.
19
+ 
20
+ @item decryption_key
21
+-16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
22
++Default 16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
23
++
24
++ at item decryption_keys
25
++Dictionary of 16-byte key ID => 16-byte key, both in hex, to decrypt files encrypted using ISO Common Encryption
26
++(CENC/AES-128 CTR; ISO/IEC 23001-7).
27
+ 
28
+ @item max_stts_delta
29
+ Very high sample deltas written in a trak's stts box may occasionally be intended but usually they are written in
30
+--- a/libavformat/dashdec.c
31
++++ b/libavformat/dashdec.c
32
+@@ -153,6 +153,7 @@
33
+     AVDictionary *avio_opts;
34
+     int max_url_size;
35
+     char *cenc_decryption_key;
36
++    char *cenc_decryption_keys;
37
+ 
38
+     /* Flags for init section*/
39
+     int is_init_section_common_video;
40
+@@ -1906,6 +1907,8 @@
41
+ 
42
+     if (c->cenc_decryption_key)
43
+         av_dict_set(&in_fmt_opts, "decryption_key", c->cenc_decryption_key, 0);
44
++    if (c->cenc_decryption_keys)
45
++        av_dict_set(&in_fmt_opts, "decryption_keys", c->cenc_decryption_keys, 0);
46
+ 
47
+     // provide additional information from mpd if available
48
+     ret = avformat_open_input(&pls->ctx, "", in_fmt, &in_fmt_opts); //pls->init_section->url
49
+@@ -2347,7 +2350,8 @@
50
+         OFFSET(allowed_extensions), AV_OPT_TYPE_STRING,
51
+         {.str = "aac,m4a,m4s,m4v,mov,mp4,webm,ts"},
52
+         INT_MIN, INT_MAX, FLAGS},
53
+-    { "cenc_decryption_key", "Media decryption key (hex)", OFFSET(cenc_decryption_key), AV_OPT_TYPE_STRING, {.str = NULL}, INT_MIN, INT_MAX, .flags = FLAGS },
54
++    { "cenc_decryption_key", "Media default decryption key (hex)", OFFSET(cenc_decryption_key), AV_OPT_TYPE_STRING, {.str = NULL}, INT_MIN, INT_MAX, .flags = FLAGS },
55
++    { "cenc_decryption_keys", "Media decryption keys by KID (hex)", OFFSET(cenc_decryption_keys), AV_OPT_TYPE_STRING, {.str = NULL}, INT_MIN, INT_MAX, .flags = FLAGS },
56
+     {NULL}
57
+ };
58
+ 
59
+--- a/libavformat/isom.h
60
++++ b/libavformat/isom.h
61
+@@ -340,8 +340,8 @@
62
+     void *audible_iv;
63
+     int audible_iv_size;
64
+     struct AVAES *aes_decrypt;
65
+-    uint8_t *decryption_key;
66
+-    int decryption_key_len;
67
++    uint8_t *decryption_default_key;
68
++    int decryption_default_key_len;
69
+     int enable_drefs;
70
+     int32_t movie_display_matrix33; ///< display matrix from mvhd
71
+     int have_read_mfra_size;
72
+@@ -356,6 +356,7 @@
73
+     int thmb_item_id;
74
+     int64_t idat_offset;
75
+     int interleaved_read;
76
++    AVDictionary* decryption_keys;
77
+ } MOVContext;
78
+ 
79
+ int ff_mp4_read_descr_len(AVIOContext *pb);
80
+--- a/libavformat/mov.c
81
++++ b/libavformat/mov.c
82
+@@ -7414,19 +7414,62 @@
83
+     return 0;
84
+ }
85
+ 
86
++static int get_key_from_kid(uint8_t* out, int len, MOVContext *c, AVEncryptionInfo *sample) {
87
++    AVDictionaryEntry *key_entry_hex;
88
++    char kid_hex16*2+1;
89
++
90
++    if (c->decryption_default_key && c->decryption_default_key_len != len) {
91
++        av_log(c->fc, AV_LOG_ERROR, "invalid default decryption key length: got %d, expected %d\n", c->decryption_default_key_len, len);
92
++        return -1;
93
++    }
94
++
95
++    if (!c->decryption_keys) {
96
++        av_assert0(c->decryption_default_key);
97
++        memcpy(out, c->decryption_default_key, len);
98
++        return 0;
99
++    }
100
++
101
++    if (sample->key_id_size != 16) {
102
++        av_log(c->fc, AV_LOG_ERROR, "invalid key ID size: got %u, expected 16\n", sample->key_id_size);
103
++        return -1;
104
++    }
105
++
106
++    ff_data_to_hex(kid_hex, sample->key_id, 16, 1);
107
++    key_entry_hex = av_dict_get(c->decryption_keys, kid_hex, NULL, AV_DICT_DONT_STRDUP_KEY|AV_DICT_DONT_STRDUP_VAL);
108
++    if (!key_entry_hex) {
109
++        if (!c->decryption_default_key) {
110
++            av_log(c->fc, AV_LOG_ERROR, "unable to find KID %s\n", kid_hex);
111
++            return -1;
112
++        }
113
++        memcpy(out, c->decryption_default_key, len);
114
++        return 0;
115
++    }
116
++    if (strlen(key_entry_hex->value) != len*2) {
117
++        return -1;
118
++    }
119
++    ff_hex_to_data(out, key_entry_hex->value);
120
++    return 0;
121
++}
122
++
123
+ static int cenc_scheme_decrypt(MOVContext *c, MOVStreamContext *sc, AVEncryptionInfo *sample, uint8_t *input, int size)
124
+ {
125
+     int i, ret;
126
+     int bytes_of_protected_data;
127
++    uint8_t decryption_keyAES_CTR_KEY_SIZE;
128
+ 
129
+     if (!sc->cenc.aes_ctr) {
130
++        ret = get_key_from_kid(decryption_key, sizeof(decryption_key), c, sample);
131
++        if (ret < 0) {
132
++            return ret;
133
++        }
134
++
135
+         /* initialize the cipher */
136
+         sc->cenc.aes_ctr = av_aes_ctr_alloc();
137
+         if (!sc->cenc.aes_ctr) {
138
+             return AVERROR(ENOMEM);
139
+         }
140
+ 
141
+-        ret = av_aes_ctr_init(sc->cenc.aes_ctr, c->decryption_key);
142
++        ret = av_aes_ctr_init(sc->cenc.aes_ctr, decryption_key);
143
+         if (ret < 0) {
144
+             return ret;
145
+         }
146
+@@ -7472,15 +7515,21 @@
147
+     int i, ret;
148
+     int num_of_encrypted_blocks;
149
+     uint8_t iv16;
150
++    uint8_t decryption_key16;
151
+ 
152
+     if (!sc->cenc.aes_ctx) {
153
++        ret = get_key_from_kid(decryption_key, sizeof(decryption_key), c, sample);
154
++        if (ret < 0) {
155
++            return ret;
156
++        }
157
++
158
+         /* initialize the cipher */
159
+         sc->cenc.aes_ctx = av_aes_alloc();
160
+         if (!sc->cenc.aes_ctx) {
161
+             return AVERROR(ENOMEM);
162
+         }
163
+ 
164
+-        ret = av_aes_init(sc->cenc.aes_ctx, c->decryption_key, 16 * 8, 1);
165
++        ret = av_aes_init(sc->cenc.aes_ctx, decryption_key, 16 * 8, 1);
166
+         if (ret < 0) {
167
+             return ret;
168
+         }
169
+@@ -7531,15 +7580,21 @@
170
+ {
171
+     int i, ret, rem_bytes;
172
+     uint8_t *data;
173
++    uint8_t decryption_keyAES_CTR_KEY_SIZE;
174
+ 
175
+     if (!sc->cenc.aes_ctr) {
176
++        ret = get_key_from_kid(decryption_key, sizeof(decryption_key), c, sample);
177
++        if (ret < 0) {
178
++            return ret;
179
++        }
180
++
181
+         /* initialize the cipher */
182
+         sc->cenc.aes_ctr = av_aes_ctr_alloc();
183
+         if (!sc->cenc.aes_ctr) {
184
+             return AVERROR(ENOMEM);
185
+         }
186
+ 
187
+-        ret = av_aes_ctr_init(sc->cenc.aes_ctr, c->decryption_key);
188
++        ret = av_aes_ctr_init(sc->cenc.aes_ctr, decryption_key);
189
+         if (ret < 0) {
190
+             return ret;
191
+         }
192
+@@ -7597,15 +7652,21 @@
193
+     int i, ret, rem_bytes;
194
+     uint8_t iv16;
195
+     uint8_t *data;
196
++    uint8_t decryption_key16;
197
+ 
198
+     if (!sc->cenc.aes_ctx) {
199
++        ret = get_key_from_kid(decryption_key, sizeof(decryption_key), c, sample);
200
++        if (ret < 0) {
201
++            return ret;
202
++        }
203
++
204
+         /* initialize the cipher */
205
+         sc->cenc.aes_ctx = av_aes_alloc();
206
+         if (!sc->cenc.aes_ctx) {
207
+             return AVERROR(ENOMEM);
208
+         }
209
+ 
210
+-        ret = av_aes_init(sc->cenc.aes_ctx, c->decryption_key, 16 * 8, 1);
211
++        ret = av_aes_init(sc->cenc.aes_ctx, decryption_key, 16 * 8, 1);
212
+         if (ret < 0) {
213
+             return ret;
214
+         }
215
+@@ -7748,7 +7809,7 @@
216
+             return AVERROR_INVALIDDATA;
217
+         }
218
+ 
219
+-        if (mov->decryption_key) {
220
++        if (mov->decryption_keys || mov->decryption_default_key) {
221
+             return cenc_decrypt(mov, sc, encrypted_sample, pkt->data, pkt->size);
222
+         } else {
223
+             size_t size;
224
+@@ -9546,12 +9607,6 @@
225
+     MOVAtom atom = { AV_RL32("root") };
226
+     int i;
227
+ 
228
+-    if (mov->decryption_key_len != 0 && mov->decryption_key_len != AES_CTR_KEY_SIZE) {
229
+-        av_log(s, AV_LOG_ERROR, "Invalid decryption key len %d expected %d\n",
230
+-            mov->decryption_key_len, AES_CTR_KEY_SIZE);
231
+-        return AVERROR(EINVAL);
232
+-    }
233
+-
234
+     mov->fc = s;
235
+     mov->trak_index = -1;
236
+     mov->thmb_item_id = -1;
237
+@@ -10351,7 +10406,8 @@
238
+         "Fixed key used for handling Audible AAX files", OFFSET(audible_fixed_key),
239
+         AV_OPT_TYPE_BINARY, {.str="77214d4b196a87cd520045fd20a51d67"},
240
+         .flags = AV_OPT_FLAG_DECODING_PARAM },
241
+-    { "decryption_key", "The media decryption key (hex)", OFFSET(decryption_key), AV_OPT_TYPE_BINARY, .flags = AV_OPT_FLAG_DECODING_PARAM },
242
++    { "decryption_key", "The default media decryption key (hex)", OFFSET(decryption_default_key), AV_OPT_TYPE_BINARY, .flags = AV_OPT_FLAG_DECODING_PARAM },
243
++    { "decryption_keys", "The media decryption keys by KID (hex)", OFFSET(decryption_keys), AV_OPT_TYPE_DICT, .flags = AV_OPT_FLAG_DECODING_PARAM },
244
+     { "enable_drefs", "Enable external track support.", OFFSET(enable_drefs), AV_OPT_TYPE_BOOL,
245
+         {.i64 = 0}, 0, 1, FLAGS },
246
+     { "max_stts_delta", "treat offsets above this value as invalid", OFFSET(max_stts_delta), AV_OPT_TYPE_INT, {.i64 = UINT_MAX-48000*10 }, 0, UINT_MAX, .flags = AV_OPT_FLAG_DECODING_PARAM },
247
+--- a/tests/fate/mov.mak
248
++++ b/tests/fate/mov.mak
249
+@@ -8,6 +8,9 @@
250
+            fate-mov-3elist-encrypted \
251
+            fate-mov-frag-encrypted \
252
+            fate-mov-tenc-only-encrypted \
253
++           fate-mov-3elist-encrypted-kid \
254
++           fate-mov-frag-encrypted-kid \
255
++           fate-mov-tenc-only-encrypted-kid \
256
+            fate-mov-invalid-elst-entry-count \
257
+            fate-mov-gpmf-remux \
258
+            fate-mov-ibi-elst-starts-b \
259
+@@ -52,6 +55,15 @@
260
+ # Full-sample encryption and constant IV using only tenc atom (no senc/saio/saiz).
261
+ fate-mov-tenc-only-encrypted: CMD = framemd5 -decryption_key 12345678901234567890123456789012 -i $(TARGET_SAMPLES)/mov/mov-tenc-only-encrypted.mp4
262
+ 
263
++# Edit list with encryption, using the decryption_keys option.
264
++fate-mov-3elist-encrypted-kid: CMD = framemd5 -decryption_keys 12345678901234567890123456789012=12345678901234567890123456789012 -i $(TARGET_SAMPLES)/mov/mov-3elist-encrypted.mov
265
++
266
++# Fragmented encryption with senc boxes in movie fragments, using the decryption_keys option.
267
++fate-mov-frag-encrypted-kid: CMD = framemd5 -decryption_keys abba271e8bcf552bbd2e86a434a9a5d9=12345678901234567890123456789012 -i $(TARGET_SAMPLES)/mov/mov-frag-encrypted.mp4
268
++
269
++# Full-sample encryption and constant IV using only tenc atom (no senc/saio/saiz), using the decryption_keys option.
270
++fate-mov-tenc-only-encrypted-kid: CMD = framemd5 -decryption_keys abba271e8bcf552bbd2e86a434a9a5d9=12345678901234567890123456789012 -i $(TARGET_SAMPLES)/mov/mov-tenc-only-encrypted.mp4
271
++
272
+ # Makes sure that the CTTS is also modified when we fix avindex in mov.c while parsing edit lists.
273
+ fate-mov-elist-starts-ctts-2ndsample: CMD = framemd5 -i $(TARGET_SAMPLES)/mov/mov-elist-starts-ctts-2ndsample.mov
274
+ 
275
+--- /dev/null
276
++++ b/tests/ref/fate/mov-3elist-encrypted-kid
277
+@@ -0,0 +1,57 @@
278
++#format: frame checksums
279
++#version: 2
280
++#hash: MD5
281
++#tb 0: 1/24
282
++#media_type 0: video
283
++#codec_id 0: rawvideo
284
++#dimensions 0: 640x480
285
++#sar 0: 0/1
286
++#stream#, dts,        pts, duration,     size, hash
287
++0,          0,          0,        1,   460800, 80fbbdec589e15e6c493b44d243f92a9
288
++0,          1,          1,        1,   460800, f4b23293bb2ecf69cc3570853d8c56a1
289
++0,          2,          2,        1,   460800, 0c03ce2c1c6ec405d7455465ecd559a3
290
++0,          3,          3,        1,   460800, 7921791695537fba2c3c123da4834cb9
291
++0,          4,          4,        1,   460800, 30c8e2903a561b84d4cbaf95c668d236
292
++0,          5,          5,        1,   460800, 7ff42e998217c17592ddf6b584f26cef
293
++0,          6,          6,        1,   460800, 5e402c48bf097db2d31b82bb4194a382
294
++0,          7,          7,        1,   460800, 824c49e92c8ae6d99a0207b514dd756c
295
++0,          8,          8,        1,   460800, 24f189216a1d9cf2313b2d6dbe3dbdd3
296
++0,          9,          9,        1,   460800, 519179a8e74275d26b183374637e003f
297
++0,         10,         10,        1,   460800, f18331ddcef0adf5b069bfa98baf8db4
298
++0,         11,         11,        1,   460800, 081f61688690d47dbdddd5384e5d5a70
299
++0,         12,         12,        1,   460800, 90dbf019b9035433371a8df41a9268b7
300
++0,         13,         13,        1,   460800, bb5adfb9c66732898b34186eca1667ba
301
++0,         14,         14,        1,   460800, cc08cfd64f37783ecddaf143f6ad78bc
302
++0,         15,         15,        1,   460800, b8ae21d024fe4df903d56f4521993c72
303
++0,         16,         16,        1,   460800, b45a99907f045dcadf0a2befc11555e3
304
++0,         17,         17,        1,   460800, 603ba935845e65ab6cccbbec88bbf60d
305
++0,         18,         18,        1,   460800, df80c8d3e6a77258a306903f17995a18
306
++0,         19,         19,        1,   460800, 4b7e90c0a5fd0e0cd958d47f0afac636
307
++0,         20,         20,        1,   460800, 9feb6e36182f1745be6387edea240eb6
308
++0,         21,         21,        1,   460800, 86e6de4bd0a5ff7558f4cf6c1ec3930d
309
++0,         22,         22,        1,   460800, 726b69df77edbe7b503d4698656d1320
310
++0,         23,         23,        1,   460800, d282fb7a953ac205b0a43d00c2d60a33
311
++0,         24,         24,        1,   460800, eece3daa70cc20208dd75d91ac84c8fd
312
++0,         25,         25,        1,   460800, c86d23e73bcce351fc315fb1f13348da
313
++0,         26,         26,        1,   460800, 93497b4f7c5ad9d61212239b7c9d2770
314
++0,         27,         27,        1,   460800, eb217d2c12de67903835a8c58f620488
315
++0,         28,         28,        1,   460800, d966480867bb54c8cd044f18388ed486
316
++0,         29,         29,        1,   460800, 3ea6207942b3181fdd8e8aa6cae1062a
317
++0,         30,         30,        1,   460800, 2620df54aca086ec0fb9527c6e6f5135
318
++0,         31,         31,        1,   460800, 43bb7320f0bb583188dc965ddbfade90
319
++0,         32,         32,        1,   460800, 0cddaa04645f804e02f65b0836412113
320
++0,         33,         33,        1,   460800, 83b2dc95807289d7f4a4632bf18c2e97
321
++0,         34,         34,        1,   460800, 98134d0e41e6dd12827049ccf33b4669
322
++0,         35,         35,        1,   460800, 56f55631731fa39c7acbab0afeb2eb1b
323
++0,         36,         36,        1,   460800, 379c1105be09d836a515dc909455ddf4
324
++0,         37,         37,        1,   460800, 1df87c47e9d98731faf1c3885b77e5da
325
++0,         38,         38,        1,   460800, 9a8734bcbfdb4d97e530683b8b556a26
326
++0,         39,         39,        1,   460800, c7a7990d0cddc5adfbe27da7a42e025e
327
++0,         40,         40,        1,   460800, 0c81e46011e03be410feaf056207fd55
328
++0,         41,         41,        1,   460800, ca76e4e63016ff29d8aeeb9cb053bb6c
329
++0,         42,         42,        1,   460800, cebfbe299c17c1f8fc1e6b189555c3c2
330
++0,         43,         43,        1,   460800, 4f002c5feca5e75f07089e0df47507dd
331
++0,         44,         44,        1,   460800, c5fd83fc4a745abee9b3d9a6eec9dd3e
332
++0,         45,         45,        1,   460800, 57d9bad9b45aa2746de5d8bdc2c24969
333
++0,         46,         46,        1,   460800, 9831673ad7dec167af4a959f64258949
334
++0,         47,         47,        1,   460800, 77a1cb208f70f51bcb01e28d8cba73b4
335
+--- /dev/null
336
++++ b/tests/ref/fate/mov-frag-encrypted-kid
337
+@@ -0,0 +1,57 @@
338
++#format: frame checksums
339
++#version: 2
340
++#hash: MD5
341
++#tb 0: 1/24
342
++#media_type 0: video
343
++#codec_id 0: rawvideo
344
++#dimensions 0: 120x52
345
++#sar 0: 544/545
346
++#stream#, dts,        pts, duration,     size, hash
347
++0,          0,          0,        1,     9360, 920bdc277a6a31c1daed9aca44b10caf
348
++0,          1,          1,        1,     9360, f1c0b61fef593de57cb97be7fa846569
349
++0,          2,          2,        1,     9360, 6ef32d9d4398355aebf6d3fb11d51d3f
350
++0,          3,          3,        1,     9360, d38fd3ef1e5a92fc109b8dd9eb6dadeb
351
++0,          4,          4,        1,     9360, 54cc0c8a25d2f14f32663837d5e646f1
352
++0,          5,          5,        1,     9360, b4b6829726dc3decb8b80ba0c35bcf30
353
++0,          6,          6,        1,     9360, fca3f941e60a2f0a4ce30d5e0efbec3c
354
++0,          7,          7,        1,     9360, cda6e26b6c1039ff3d229b262c9210c3
355
++0,          8,          8,        1,     9360, f0d69255e3a27a8b4ae8a4b7b210929d
356
++0,          9,          9,        1,     9360, 12cb23dd4e32af9c3b35f943714e3fdd
357
++0,         10,         10,        1,     9360, 082aaf3216124ddcecb422fe5c832e82
358
++0,         11,         11,        1,     9360, ff37bb8cd6bd0412a3b3cb45db54afc9
359
++0,         12,         12,        1,     9360, dfb9085441575732844b6c2f05d5f542
360
++0,         13,         13,        1,     9360, 0017100feaaa9fc7eacd2447d50d7542
361
++0,         14,         14,        1,     9360, 4e2f1b8c4e04c59934c2f58541e62613
362
++0,         15,         15,        1,     9360, 27a44dfea7cd2d30e488194c34ab473c
363
++0,         16,         16,        1,     9360, fc7b56bd95e990a33cf575d1ef820902
364
++0,         17,         17,        1,     9360, fa2d1609e69714dffc410e65f3c8b755
365
++0,         18,         18,        1,     9360, 705d7429f447cb13febe202d567795f2
366
++0,         19,         19,        1,     9360, 234802ce86e868faaf2cd40a286846ea
367
++0,         20,         20,        1,     9360, 2f0354b40d211d0a4ade4568bea4f85e
368
++0,         21,         21,        1,     9360, e96af3b6c0cc931463ca77d6be0f1148
369
++0,         22,         22,        1,     9360, 04a904d798361959971361401879c7e4
370
++0,         23,         23,        1,     9360, 2f119642340df6d25362b5590ded46b7
371
++0,         24,         24,        1,     9360, 5993fca2e60050706f857ac76e48f386
372
++0,         25,         25,        1,     9360, 2ff3b5775fed3d527bfbbeea786787fe
373
++0,         26,         26,        1,     9360, 42024dbe23d3fb5b0d8987ae1ce390a8
374
++0,         27,         27,        1,     9360, d804204f0bd9db5f6a758e2c934d9e38
375
++0,         28,         28,        1,     9360, e322712e6e34c58ec1a2ab5e2c1e3bfe
376
++0,         29,         29,        1,     9360, 3975bd1a5f6a6b6260276777f9de611e
377
++0,         30,         30,        1,     9360, 4388f0412efc6310706a7cdedc859ea9
378
++0,         31,         31,        1,     9360, b4b9a11b0b86635267345a569640e8d4
379
++0,         32,         32,        1,     9360, 31879c7b8d6b67a4209ffde786bb8cb4
380
++0,         33,         33,        1,     9360, 4b6dc02d7c889fe4abd4e013b25f585a
381
++0,         34,         34,        1,     9360, dc73aae82bd39a1220d1106c8d3e8252
382
++0,         35,         35,        1,     9360, 54c7dfbd49f312806f6c1a89f7c2c36f
383
++0,         36,         36,        1,     9360, 150abc64f8994d444a521ea90570443c
384
++0,         37,         37,        1,     9360, d277cdc7dcadbe0016f2e950459e7ebf
385
++0,         38,         38,        1,     9360, 2196bf338ead90ea54687b85c73c8229
386
++0,         39,         39,        1,     9360, 53ce5da5365abc0bd3217dd98e7c465d
387
++0,         40,         40,        1,     9360, 34ee9832aea55c0c4e6f4381c413c10e
388
++0,         41,         41,        1,     9360, 1769c7b5849e4681119067a06ac29a4f
389
++0,         42,         42,        1,     9360, 71f53df739ef283a5184c91ef4b158e8
390
++0,         43,         43,        1,     9360, d2d394739e9a59c06f0354c16843cb63
391
++0,         44,         44,        1,     9360, d8e458e92ae29344505a24a3059fc584
392
++0,         45,         45,        1,     9360, 0f1b11a09911851b798df2ef76253a7f
393
++0,         46,         46,        1,     9360, 5c4a9f22baecf4e749c0d5c65a4f1007
394
++0,         47,         47,        1,     9360, 3e2b7e7262fdca08d9d1ef6070125c4b
395
+--- /dev/null
396
++++ b/tests/ref/fate/mov-tenc-only-encrypted-kid
397
+@@ -0,0 +1,57 @@
398
++#format: frame checksums
399
++#version: 2
400
++#hash: MD5
401
++#tb 0: 1/24
402
++#media_type 0: video
403
++#codec_id 0: rawvideo
404
++#dimensions 0: 1024x436
405
++#sar 0: 1/1
406
++#stream#, dts,        pts, duration,     size, hash
407
++0,          0,          0,        1,   669696, f48f296a85eda5ba069dc851a3228bef
408
++0,          1,          1,        1,   669696, a50c5f69bfa3387d49b5bdf738e6529c
409
++0,          2,          2,        1,   669696, 05061299003760f6a4795b408f72aa31
410
++0,          3,          3,        1,   669696, 2572119f0b0cdd83f8a7e06252cecd3b
411
++0,          4,          4,        1,   669696, 29fe6a6bdb4a69018e318886a297f07e
412
++0,          5,          5,        1,   669696, e8233c7fbaecfbff965c7dfdd3982b1b
413
++0,          6,          6,        1,   669696, d9259df9880ff5d4a4b38282e67f407b
414
++0,          7,          7,        1,   669696, 3e8d795195038993503ea9ab6984c915
415
++0,          8,          8,        1,   669696, bc4e2d253b715a34f85aae1b080e3460
416
++0,          9,          9,        1,   669696, 09aba8b3a96f53f9268e7420a10bfab6
417
++0,         10,         10,        1,   669696, 179447977dd580da8b35fb5310a809ca
418
++0,         11,         11,        1,   669696, 7a0eea9d54577990345f5705ab9882be
419
++0,         12,         12,        1,   669696, 5bb96eb76f461825740e5938456df759
420
++0,         13,         13,        1,   669696, bd4ac4a760ead774b9422a27dc071964
421
++0,         14,         14,        1,   669696, 1cc05f760a9b751fc89e77f2bcc97259
422
++0,         15,         15,        1,   669696, 825d0dee6f0174ba7102892c7de30b4d
423
++0,         16,         16,        1,   669696, d26a2ef5267f6bb03c4e1d8514eee0df
424
++0,         17,         17,        1,   669696, c916ffdeadca76596a8f7fd47914b5ef
425
++0,         18,         18,        1,   669696, 6e085acfa7fee0658ea0ae6188274c17
426
++0,         19,         19,        1,   669696, 1e95fa5b3561283f05bf0bd44cb91721
427
++0,         20,         20,        1,   669696, 37e3d135aba9dfb8b87e441753115374
428
++0,         21,         21,        1,   669696, 9c398310e8564491de624393c16265ce
429
++0,         22,         22,        1,   669696, c87209e4d2617bc2ab40a75f455f09da
430
++0,         23,         23,        1,   669696, 2679c2f8d1d1af21982e245945c1ee60
431
++0,         24,         24,        1,   669696, 6151ab4781f31c5beb66b356ad547122
432
++0,         25,         25,        1,   669696, f7ef6293bfb3a6a329061cb6a5ed5a38
433
++0,         26,         26,        1,   669696, 2f6e666d14dfc407ca0c0f347b13eb08
434
++0,         27,         27,        1,   669696, 3454fa1730d79b1aa8dbbc865dc150f4
435
++0,         28,         28,        1,   669696, e93dc683e2453419a0419ab9af0f8f95
436
++0,         29,         29,        1,   669696, 031eb3154f7f83cf86d42bee66be9cf7
437
++0,         30,         30,        1,   669696, 1205c36723e88811206c68892d3aaed6
438
++0,         31,         31,        1,   669696, 7dd7a8a19dcd73b31ddc6a6d0c597a42
439
++0,         32,         32,        1,   669696, 7c91115368ea2531262a1197468bc3f4
440
++0,         33,         33,        1,   669696, 3cf6d9ba385e0fff76da33299ed5380c
441
++0,         34,         34,        1,   669696, 859fc8c3ef049e3c1175a85fb0a90a3d
442
++0,         35,         35,        1,   669696, 1d09ce6c7027103d99a4d5799f6e72ab
443
++0,         36,         36,        1,   669696, 3dcb8357408ac88abd734128d8f5dd6f
444
++0,         37,         37,        1,   669696, 4dafce137a0a5178f6efaec878e64d36
445
++0,         38,         38,        1,   669696, 44c478f29a1399ed03275a7357f57d48
446
++0,         39,         39,        1,   669696, 6e9edaac7414c0e14591ac3d4d0b1ac4
447
++0,         40,         40,        1,   669696, 522e4aaeea0825da27f631a9e690d654
448
++0,         41,         41,        1,   669696, 85f2502a718440834c40051d30f8a65e
449
++0,         42,         42,        1,   669696, ae8816f7bd4645ef1a17ee6d09b4c8d2
450
++0,         43,         43,        1,   669696, 914b006fa92f1eb3e590245749f6810d
451
++0,         44,         44,        1,   669696, 9406901542e94c429dff46108782ed69
452
++0,         45,         45,        1,   669696, 324c13641c39eef5c476023e358c0391
453
++0,         46,         46,        1,   669696, 4058e886e17c22e4eb9da1dd0d6ad891
454
++0,         47,         47,        1,   669696, 9edf9cd15eea985b42fd1f5035b1d693
455
+-- 
456