-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Missing AES-128 key of last HLS segment #4519
Conversation
@theodab can you review it? You are the expert in AES-128 |
Incremental code coverage: 100.00% |
test/media/segment_index_unit.js
Outdated
@@ -955,9 +955,11 @@ describe('SegmentIndex', /** @suppress {accessControls} */ () => { | |||
* @param {number} startTime | |||
* @param {number} endTime | |||
* @param {!Array.<!shaka.media.SegmentReference>=} partialReferences | |||
* @param {!shaka.extern.HlsAes128Key} hlsAes128Key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: If this is an optional parameter, the type should end with an equals sign to signify that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review. I fixed it!
test/media/segment_index_unit.js
Outdated
* @return {shaka.media.SegmentReference} | ||
*/ | ||
function makeReference(uri, startTime, endTime, partialReferences = []) { | ||
function makeReference(uri, startTime, endTime, partialReferences = [], | ||
hlsAes128Key = {method: 'AES-128', firstMediaSequenceNumber: 0}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to default that to non-null at all times in all tests?
Could you instead make a regression test for this particular bug, where you show that hlsAes128Key is preserved on the last segment after a fit() call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for finding and fixing this bug, and thank you for contributing! |
@devsunb can you rebase to resolve the issues in the tests? Thank you! |
@devsunb please fix the linter errors, thanks! |
I fixed it! Sorry for my oversight. |
Thanks for your contribution! I'll merge this after the new test run is complete. |
When fitting the segment references to the timeline, some properties were lost, including the AES-128 key. This fixes those missing properties. Closes #4517
🤖 I have created a release *beep* *boop* --- ## [4.2.2](v4.2.1...v4.2.2) (2022-10-07) ### Bug Fixes * allow build without text ([#4506](#4506)) ([7e93720](7e93720)) * allow the playback on platforms when low latency APIs are not supported ([#4485](#4485)) ([cf8c857](cf8c857)) * check for negative rows before moving ([#4510](#4510)) ([23f39d7](23f39d7)), closes [#4508](#4508) * Filter unsupported H.264 streams in Xbox ([#4493](#4493)) ([914a08a](914a08a)) * Fix choppy HLS startup ([#4553](#4553)) ([950ce69](950ce69)), closes [#4516](#4516) * Fix errors with TS segments on Chromecast ([#4543](#4543)) ([8204db6](8204db6)) * Fix hang when seeking to the last segment ([#4537](#4537)) ([3d6c768](3d6c768)) * Fix HLS dynamic to static transition ([d9ecbf3](d9ecbf3)) * Fix HLS dynamic to static transition ([#4483](#4483)) ([d9ecbf3](d9ecbf3)), closes [#4431](#4431) * Fix in-band key rotation on Xbox One ([#4478](#4478)) ([bc0a588](bc0a588)), closes [#4401](#4401) * Missing AES-128 key of last HLS segment ([#4519](#4519)) ([2c2677f](2c2677f)), closes [#4517](#4517) * Respect existing app usage of Cast SDK ([#4523](#4523)) ([3db2568](3db2568)), closes [#4521](#4521) * **ttml:** Default TTML background color to transparent if unspecified ([#4496](#4496)) ([0b5c985](0b5c985)), closes [#4468](#4468) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Closes #4517
Problem
Fetching the last segment of HLS AES-128 stream fails with 3018 error
MediaSourceEngine
attempts to transmux encrypted TS dataStreamingEngine
does not decrypt TS data of the last segmentSegmentReference
of the last segment hasnull
forhlsAes128Key
hlsAes128Key
is missing when adjusting the last SegmentReference inSegmentIndex.fit()
Test
Before
After